Skip to content

Format with fixed notation not working for very large values #291

@josdejong

Description

@josdejong
var x = 1e+27;

console.log(math.format(x, {notation: 'fixed'}));
// output: "1e+27"
// expected: "1000000000000000000000000000"

console.log(math.format(x, {notation: 'auto', exponential: {lower: 1e-100, upper: 1e+100}}));
// output: "1e+27"
// expected: "1000000000000000000000000000"

This has to do with the 21 digit limit of JavaScripts toPrecision function.

Would be nice to support fixed notation for very large values too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions