scurker / currency.js

A javascript library for handling currencies

Home Page:https://currency.js.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Handling NaN

imtyM opened this issue · comments

The internal parse function extracts a valid number from the value provided for numerous cases, and defaults to 0 when it can't. Since typeof NaN is number, NaN is a valid value for a currency object.

Is this intended? And why?
For our project, it's very useful for the value to default to 0 when the value provided to currency is NaN.

I could attempt to add a check for NaN if this is not intended. :)