You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by "im0505 (via GitHub)" <gi...@apache.org> on 2025/06/16 02:50:32 UTC

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

im0505 opened a new issue, #21036:
URL: https://github.com/apache/echarts/issues/21036

   ### 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](https://github.com/apache/echarts/blob/master/src/util/number.ts) (line 146) produces floating-point errors.
   
   ![Image](https://github.com/user-attachments/assets/749c7ddb-bd79-4130-b400-23f90e4aded2)
   
   ### Expected Behavior
   
   axis label value should be increased by interval 
   
   <img width="144" alt="Image" src="https://github.com/user-attachments/assets/2af997c5-f330-497b-8865-0b945250d4c4" />
   
   ### Environment
   
   ```markdown
   - OS:
   - Browser:
   - Framework:
   ```
   
   ### Any additional comments?
   
   _No response_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org