Skip to content

Math float issue arises when formatting certain numbers #10

@ragulka

Description

@ragulka

Trying to format a number like 123456789201921 reveals the underlying issue with float-precision math that JS has. The result is something like 123,456,789,201,920.992 while it should be 123,456,789,201,921.

I stumbled upon this while working on my own fork of Numeral-JS. The issue can probably only be solved if using a specialized library like Big.js

Of course, this is probably an edge case, but perhaps it is something to be considered.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions