Skip to content

Plugin is rounding decimal numbers value for "large" numbers #17

@jsanta

Description

@jsanta

Hi.
I'm getting some differences in expected value an resulting value. Tried

$.format.number(123456789.36, '#,##0.00')
returns: "123,456,789.36"

and works as expected returning a "123,456,789.36"

Tried

$.format.number(123412365456789.36, '#,##0.00')
returns: "123,412,365,456,789.37"

$.format.number(123456789123456789.99, '#,##0.00')
returns: "123,456,789,123,456,780.00"

$.format.number(99876543212323.69, '#,##0.00');
returns: "99,876,543,212,323.68"

and the return values are clearly different from the expected formatted numbers:

  • "123,412,365,456,789.36"
  • "123,456,789,123,456,789.99"
  • "99,876,543,212,323.69"

(regardless any rounding that has to be made, numbers have to respect their value unless a rounding is really needed).

I hope you can provide a patch for this issue. For the project I'm working on I can make an ugly replacement (based on String comparing), but it won't solve the issue.

Best regards from Chile.

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