We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Is there a way to call .format() and not have it append trailing zeros i'm not seeing?
Globalize.format( 123.45, "n3" ) -> 123.450
I would like it to return 1234.45. The real issue is how ugly the formatting can be on larger numbers like n9.
Globalize.format( 123.45, "n9" ) -> 123.4500000000 Globalize.format( 123.123456, "n9" ) -> 123.123456000
The text was updated successfully, but these errors were encountered:
Now (1.x), you can:
> Globalize.formatNumber(123.45, {maximumFractionDigits: 5}) '123.45' > Globalize.formatNumber(123.456789, {maximumFractionDigits: 5}) '123.45679'
The 0-padded analogue is:
> Globalize.formatNumber(123.45, {minimumFractionDigits: 5, maximumFractionDigits: 5}) '123.45000' > Globalize.formatNumber(123.456789, {minimumFractionDigits: 5, maximumFractionDigits: 5}) '123.45679'
If you need your fraction to be capped at 2 digits, use maximumFractionDigits: 2.
maximumFractionDigits: 2
For more info, read https://github.com/jquery/globalize/blob/master/doc/api/number/format.md.
Sorry, something went wrong.
No branches or pull requests
Is there a way to call .format() and not have it append trailing zeros i'm not seeing?
Globalize.format( 123.45, "n3" ) -> 123.450
I would like it to return 1234.45. The real issue is how ugly the formatting can be on larger numbers like n9.
Globalize.format( 123.45, "n9" ) -> 123.4500000000
Globalize.format( 123.123456, "n9" ) -> 123.123456000
The text was updated successfully, but these errors were encountered: