Skip to content

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

Open
@im0505

Description

@im0505

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions