Numeral-js: NaN returned if value < 1e-6

Created on 2 Oct 2017  路  8Comments  路  Source: adamwdraper/Numeral-js

I need my app to display formatted values less than 0.00000100. However numeral returns NaN for such values.

Here are reproducible test cases:

console.log(`1e-8, ${numeral(1e-8).format('0,0.00000000')}`) //output: NaN
console.log(`1e-7, ${numeral(1e-7).format('0,0.00000000')}`) //output: NaN
console.log(`9e-7, ${numeral(9e-7).format('0,0.00000000')}`) //output: NaN
console.log(`9.999999e-7, ${numeral(9.999999e-7).format('0,0.00000000')}`) //output: NaN
console.log(`1e-6, ${numeral(1e-6).format('0,0.00000000')}`) //output: 0.00000100

Please fix this. Thank you.

Most helpful comment

Has this repository been abandoned? We need a new maintainer to fix this problem that I still experience (and any other problems).

All 8 comments

I have the same problem. Everything below e-6 is not working. Any ideas how to fix this?

This is a duplicate of #514 and #512. There are already several pull requests to fix it.

@thmaterna @RaviDasari @JasonRammoray @adamwdraper Any update on the status of this issue?

There are 2 open issues, #512 and #563, and 2 PRs #564 and #514 open to fix this issue.

@adamwdraper would you be able to review #564? @thmaterna has noted #514 will not cover all cases.

unfortunately, no update from @adamwdraper

Has this repository been abandoned? We need a new maintainer to fix this problem that I still experience (and any other problems).

@tab00 see #431

Have you tried numbro?

fuck

Was this page helpful?
0 / 5 - 0 ratings

Related issues

anselms picture anselms  路  4Comments

chumager picture chumager  路  3Comments

Eric24 picture Eric24  路  8Comments

GitzJoey picture GitzJoey  路  4Comments

jfstephe picture jfstephe  路  4Comments