negative BigNumber values always return in exponential notation ignoring formatOptions. I expect 1-2 = -1, but it returns 1-2 = -1e+0
let bigmath = math.create({
number: "BigNumber"
})
const formatOptions = {
notation: "auto", // 'auto', 'fixed', 'exponential' and "engineering"
fraction: "decimal", //'ratio', 'decimal',
precision: 99,
lowerExp: -99,
upperExp: 99
}
let answer=bigmath.eval("1-2")
bigmath.format(answer, formatOptions)
You can try it here on codesanbox.
Thanks for reporting @husayt! Fixed via https://github.com/josdejong/mathjs/commit/0721626422834be78b14fd40f9652b71e45936b8 (will do a release within a few days)
This should be fixed now in v5.4.1.
Most helpful comment
This should be fixed now in
v5.4.1.