parse-any-num
v0.0.1
Published
Parse Any Number! Includes support for exponential notation, numerical separators, commas, an extra plus sign, and various forms of infinity
Downloads
1
Readme
parse-any-number
Parse Any Number! Includes support for exponential notation, numerical separators, commas, an extra plus sign, and various forms of infinity
install
npm install parse-any-num
usage
import parseAnyNum from "parse-any-num";
// alternative spellings of infinity
parseAnyNum("-inf")
-Infinity
// signed zeros
parseAnyNum("-0")
-0
// comma separated
parseAnyNum("1,234")
1234
// dollars
parseAnyNum("$0.12")
0.12
// decimal numbers
parseAnyNum("0.1234")
0.1234