parse-thousands
v0.1.0
Published
Parse thousands with custom separator: '1,000,000.1' => 1000000.1
Downloads
3
Readme
parse-thousands
Parse thousands with custom separator: '1,000,000.1' => 1000000.1
Demo: vovanr.github.io/parse-thousands
Install
npm install --save parse-thousands
Usage
var parseThousands = require('parse-thousands');
parseThousands('1 000');
//=> 1000
parseThousands('5000');
//=> 5000
parseThousands('1`000`000');
//=> 1000000
parseThousands("10'000");
//=> 10000
parseThousands('-100 000');
//=> -100000
parseThousands('10 000.0001')
//=> 10000.0001
parseThousands();
//=> ''
License
MIT © Vladimir Rodkin