Skip to content
New issue

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

numberFormatter method returns exponential view of number #750

Closed
KhrystynaPopadyuk opened this issue Jun 30, 2017 · 3 comments
Closed

numberFormatter method returns exponential view of number #750

KhrystynaPopadyuk opened this issue Jun 30, 2017 · 3 comments
Labels

Comments

@KhrystynaPopadyuk
Copy link

Hi,

I have numeric value 2e-7. In order to display it to user I use numberFormatter method (minimumIntegerDigits = 1, minimumFractionDigits = 0, maximumFractionDigits = 10) and as result I expect to get something like "0,0000002" but I get "2e-7".
How can I avoid exponential notation when format such values?

Thanks

@rxaviers rxaviers added the bug label Jun 30, 2017
@rxaviers
Copy link
Member

Hi, this is a bug and this code needs fix.

@rxaviers
Copy link
Member

rxaviers commented Jun 30, 2017

Instead of using String(number), we needed to use this:

2e-7.toFixed(7)
'0.0000002'

@rxaviers
Copy link
Member

This is fixed! Will be release in 1.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants