echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Bug] axisLabel precision causes floating-point error in number formatting (toFixed)

Open im0505 opened this issue 8 months ago • 0 comments

Version

5.6.0

Link to Minimal Reproduction

https://echarts.apache.org/examples/en/editor.html?c=bar-simple&lang=ts&code=PYBwLglsB2AEC8sDeAoWsDmAnCATAXMmurADYCmAZmIQMwAM9ANMQL4voAeAgpxAM6FUJWGACeIcoQDkAYwCGYchmBYx0jiVyL5hANrSAsjA2xpAFQCu5U9IDq5XLfMALS7YBiOaQF02msV4BIWJ0cUkZADd5UmsNUNgIaCUsaNJCegA6egA2AHZ6AFY8gCYATgBGHOqavM10AFt5TkJYLIraABYKis7CgA5aIeGu-tgGpMIAWiyS-h68iv68wsY1-bH-EFIIMAA5SwaAI3IsQkL_Yn5TiHJBWD0E4RFYbTBdB4SRLNyizpz-n0xt9smUSv0mLAviQfowynkcoUcpDoegfiVaP0yiiXjDsrkMf1UbAfMDRBIpGYjvIsNIEqxiH5WABuIA

Steps to Reproduce

see Link to Minimal Reproduction

Current Behavior

the axis label formatting via (+x).toFixed(precision) in src/util/number.ts (line 146) produces floating-point errors.

Image

Expected Behavior

axis label value should be increased by interval

Image

Environment

- OS:
- Browser:
- Framework:

Any additional comments?

No response

im0505 avatar Jun 16 '25 02:06 im0505