Stringify 0 as axios treats it as ""

Also add a check that we don't try to log(0)
This commit is contained in:
Joe Knapper 2026-02-23 17:48:26 +00:00
parent eec4b6c380
commit 25a839bf88
2 changed files with 4 additions and 3 deletions

View file

@ -346,7 +346,8 @@ export default {
}
// Rounding to about 5 sig figs to stop weird javascript rounding.
const magnitude = Math.floor(Math.log10(Math.abs(newValue)));
const absVal = Math.abs(newValue);
const magnitude = absVal > 0 ? Math.floor(Math.log10(absVal)) : 0;
const factor = 10 ** -(Math.floor(magnitude) - 4);
this.internalValue = Math.round(newValue * factor) / factor;
},