Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

multi-number-parse

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

multi-number-parse - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc