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

Error when numeral(999.999).format('0,0.[00] a') #788

Open
tianxiuali opened this issue Aug 2, 2023 · 1 comment
Open

Error when numeral(999.999).format('0,0.[00] a') #788

tianxiuali opened this issue Aug 2, 2023 · 1 comment

Comments

@tianxiuali
Copy link

Example:

numeral(999.999).format('0,0.[00] a')

The result is "1", not "1 k".

Also in another example:

numeral(999999.999).format('0,0.[00] a')

The result is "1 k", not "1 m".

@hungtcs
Copy link

hungtcs commented Sep 12, 2024

I have a similar problem, but there should be no spaces in your formatting.

// should be 1k
console.log(numeral(999.999).format("0,0.[00]a")); // 1,000

// that's right
console.log(numeral(999999.999).format("0,0.[00]a")); // 1m

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

No branches or pull requests

2 participants