Parsing behavior is weird, invalid numeral values aren't always NaN
See original GitHub issueI’m playing around with sanitizing some bulk data and came across this:
numeral('2:23:57').value()
8637
numeral('hello').value()
null
isNaN(numeral('hello').value())
false
This contradicts the documentation here which asserts two things:
numeral('2:23:57')should be invalid, but it isn’t. Not sure how it’s coming up with a value of 8637. Could this be a bug?numeral('some invalid string').value()should equal NaN, but is insteadnull. This is a breaking issue because validating numerals usingisNaN()no longer works!
Issue Analytics
- State:
- Created 6 years ago
- Comments:5
Top Results From Across the Web
Big-query does now cast automatically long decimal values to ...
According to the documentation, BigQuery's NUMERIC type has a limit of 9 decimal digits: Decimal values with 38 decimal digits of precision ...
Read more >NaN - JavaScript - MDN Web Docs
The global NaN property is a value representing Not-A-Number. ... NaN and its behaviors are not invented by JavaScript.
Read more >Navigating The Hell of NaNs in Python - Towards Data Science
NaN stands for Not A Number and is a common missing data representation. It is a special floating-point value and cannot be converted...
Read more >NaN - Wikipedia
In computing, NaN standing for Not a Number, is a member of a numeric data type that can be interpreted as a value...
Read more >parseFloat alternative? · Issue #11 · tc39/proposal-numeric ...
However, let's be very clear that Number.parse cannot exhibit the exact same behavior as Number . The latter should never return anything but ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

numeral('2:23:57').value()returns8637Same with 1-18, value comes up as -118.