fix(axes): format tick labels correctly for small numbers in exponential notation
What this PR does
This PR fixes a bug in src/plots/cartesian/axes.js where formatting very small numbers could result in invalid tick strings (e.g. "-9.381779999999999e-") when String(v) produces exponential notation but the numFormat logic slices the string indiscriminately.
Fix details
When exponential notation is present, the logic now separates the mantissa from the exponent, applies precision formatting to the mantissa, and re-attaches the exponent string, avoiding string truncation that removes the exponential component.
Tested against locally failing reproductions and verified using test-jasmine to ensure no existing suites are broken.
@camdecoster Applied! Replaced the custom mantissa slicing with a clean oFixed call.
There was some funkiness with adding the rounding increment, so I made a few changes. Now the tests are passing! Speaking of which, could you please add some tests that check this new approach? Also, could you please add a draftlog?
Hi @camdecoster, I've added the tests for this approach in numformat_test.js and added the draftlog as requested! All CI checks are passing successfully. Let me know if there's anything else needed.
Friendly nudge @camdecoster! As everything is fully updated and all CI checks are passing, could you please take another look and approve this so we can merge? Thank you!
I'm taking a look today.