parse currency
Just a simple function to parse currency values.
install
npm i -S parse-currency
and use it
// ORconst parseCurrency = const foo = console // 10.5 const bar = console // 1000000.25
behavior
- it only works with USD formated currencies. for now
- if an empty string or a non-string value is passed,
parseCurrency
returnsnull
. parseCurrency
is a pure function, it does not mutate the provided string.
FAQ
- Why such small module?: Sindre gives a good answer to this.