Numeral-js icon indicating copy to clipboard operation
Numeral-js copied to clipboard

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

Open tianxiuali opened this issue 2 years ago • 1 comments

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".

tianxiuali avatar Aug 02 '23 08:08 tianxiuali

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

hungtcs avatar Sep 12 '24 01:09 hungtcs