Number formatting

Posted by: benoit.laplante on 7 July 2021, 5:03 pm EST

  • Posted 7 July 2021, 5:03 pm EST

    In doc, Globalize.formatNumber specify it follow .NET standard number format.

    I found some difference with the g specification using wijmo 5.20211.794

    1. The default number of precision is 2 instead of 15
    expect(Globalize.formatNumber(0.453,"g")).toBe("0.453"); //display 0.45 instead
    
    1. Precision specifier: Number of significant digits.
    expect(Globalize.formatNumber(0.000453,"g2")).toBe("0.00045"); //display 0 instead 
    

    Are you following the .Net spec exactly or the difference are intentional?

  • Posted 8 July 2021, 6:24 am EST

    Hi Benoit,

    This issue may be a bug. I have escalated this to the dev team with an internal tracking id WJM-20432. I will update you once I will hear from them.

    Regards,

    Ashwin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels