multi-number-parse
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "multi-number-parse", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Number parser that tries to guess the format", | ||
@@ -5,0 +5,0 @@ "main": "./dist/index.js", |
@@ -29,2 +29,8 @@ # Multi-Number Parse _(multi-number-parse)_ | ||
parse('2.654$10'); // returns 2654.1 | ||
parse('2,45EUR'); // extra suff at the end is stripped, returns 2.45 | ||
parse('-2,543.56'); // negative numbers are OK, returns -2543.56 | ||
parse('10 345,234.21'); // returns NaN, too many different separators | ||
parse('1.123.234,534,234'); // returns NaN, impossible to detect the decimal separator | ||
parse('10.4,2'); // returns NaN, malformed digit groups | ||
parse('1.123.2'); // returns NaN, also malformed digit groups | ||
``` | ||
@@ -34,4 +40,4 @@ | ||
Found a bug? Feel free to open an issue or make a pull request. Always include tests, either for | ||
the bug or for your changes. | ||
Found a bug? Feel free to [open an issue](https://github.com/mjamado/multi-number-parse/issues) or | ||
make a pull request. Always include tests, either for the bug or for your changes. | ||
@@ -38,0 +44,0 @@ ## License |
@@ -24,6 +24,6 @@ import { assert } from 'chai'; | ||
const incorrectNumbers = [ | ||
'10 345,234.21', // too many separators | ||
'1.123.234,534,234', // more than a decimal separator | ||
'10.4,2', // bad divisions | ||
'1.123.2', // bad trailing | ||
'10 345,234.21', // too many different separators | ||
'1.123.234,534,234', // impossible to detect where's the decimal separator | ||
'10.4,2', // malformed digit groups | ||
'1.123.2', // also malformed digit groups | ||
]; | ||
@@ -30,0 +30,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
10219
44