You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While it makes sense to prevent the 0 value to have any decimal, it also prevent the call to formatNumber. I think it should be possible to achieve the same by still calling the formatNumber in any case but forcing the minimumFractionDigits to 0 if the value is 0.
Context
I want the 0 to be formatted the same as other values because otherwise it does not look well when using percent or currency values to have juste "0" without the unit.
chart.js version
4.4.2
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered:
Expected behavior
The 0 value is formatted as the other ticks when a "format" config is provided in
scales.y.ticks.format
Current behavior
The 0 is never formatted
Reproducible sample
https://codepen.io/SosthenG/pen/rNXNPPL
Optional extra steps/info to reproduce
No response
Possible solution
Issue is here :
Chart.js/src/core/core.ticks.js
Lines 28 to 31 in ea88dba
While it makes sense to prevent the 0 value to have any decimal, it also prevent the call to formatNumber. I think it should be possible to achieve the same by still calling the formatNumber in any case but forcing the minimumFractionDigits to 0 if the value is 0.
Context
I want the 0 to be formatted the same as other values because otherwise it does not look well when using percent or currency values to have juste "0" without the unit.
chart.js version
4.4.2
Browser name and version
No response
Link to your project
No response
The text was updated successfully, but these errors were encountered: