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

Handle scientific notation numbers #444

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yhnavein
Copy link

@yhnavein yhnavein commented Oct 17, 2020

added unit tests to prove it does the work
chore: added vscode config that won't break anything in this project

The reason I did this change is that before when I was formatting small numbers I was seeing huge numbers instead. Take a look:

<NumberFormat displayType="text" value={0.00000041} thousandSeparator={' '} decimalScale={20} />
or
<NumberFormat displayType="text" value={4.1e-7} thousandSeparator={' '} decimalScale={20} />

would render 5 000 000.000 for some strange reason. Apparently numbers given in a scientific notation are handled very poorly.

I've added a simple support for scientific notation to the NumberFormat component and now it looks much better.

BTW - I've added very simple VSCode config so that it won't prettify whole files on save.

added unit tests to prove it does the work
chore: added vscode config that won't break anything in this project
chore: do not include dev files in npm package
@yhnavein
Copy link
Author

Bumping topic...

@lorenzoa7
Copy link

Any updates on this?

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

Successfully merging this pull request may close these issues.

2 participants