question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NaN returned if value < 1e-6

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:21
  • Comments:8

github_iconTop GitHub Comments

6reactions
tab00commented, Apr 11, 2018

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

2reactions
huihongzhoucommented, Mar 30, 2021

fuck

Read more comments on GitHub >

github_iconTop Results From Across the Web

NaN - JavaScript - MDN Web Docs
The global NaN property is a value representing Not-A-Number. ... isNaN() : the former will return true if the value is currently NaN ......
Read more >
The NaN story, short version - Nim forum
NaN is a very special floating point value. Comparing a float with NaN gives always false, so testing for NaN does not work...
Read more >
Handling Missing Data | Python Data Science Handbook
Here and throughout the book, we'll refer to missing data in general as null, NaN, or NA values. Trade-Offs in Missing Data Conventions¶....
Read more >
Simple Method for Finding if ANY NaN values occur in a matrix.
Simple Method for Finding if ANY NaN values... Learn more about nan's, infinities, matrix, vector, array MATLAB.
Read more >
LogBackward returned nan values in its 0th output - autograd
Can you maybe tell me if anyline I should use to catch the number that is causing that issue or anyways to recover...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found