Skip to content

Support decimals #2

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

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

Conversation

gabrielflorit
Copy link

This PR supports decimals, but it doesn't throw an error on non-numeric strings.

@jtara1
Copy link

jtara1 commented May 4, 2021

@cappslock thoughts on the PR?

@cappslock
Copy link
Owner

Hi, I'm not really maintaining this repository as this is now a standard feature in JavaScript. If you need this functionality, let me suggest:

new Intl.NumberFormat('en-US').format(123456.789)
// 123,456.789

@jtara1
Copy link

jtara1 commented May 6, 2021

Node.js 12.11+ currently supports this and Node.js 10 is no longer LTS since last Friday so the timing works out. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/NumberFormat

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.

3 participants