New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

negative BigNumber values always return in exponential notation #1378

Closed
husayt opened this Issue Jan 8, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@husayt
Copy link

husayt commented Jan 8, 2019

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.

@josdejong josdejong added the bug label Jan 8, 2019

@josdejong josdejong closed this in 0721626 Jan 8, 2019

@josdejong

This comment has been minimized.

Copy link
Owner

josdejong commented Jan 8, 2019

Thanks for reporting @husayt! Fixed via 0721626 (will do a release within a few days)

@josdejong

This comment has been minimized.

Copy link
Owner

josdejong commented Jan 10, 2019

This should be fixed now in v5.4.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment