
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
intl-number-parser
Advanced tools
Utility for parsing international numbers to native JavaScript numbers based on the locale
🔢 A JavaScript function that parses numbers in various international number systems (locale) to native JavaScript numbers.
Intl-Number-Parser is a lightweight and easy-to-use JavaScript function that
allows you to parse numbers in different international number systems to native
JavaScript numbers. It uses the built-in Intl object to format and parse
numbers based on the locale specified.
The function provides support for different number systems and supports different formats for negative numbers and currencies. Internally, the function
uses Intl.NumberFormat. Currently, it assumes positional and decimal
numerals.
To use the Intl-Number-Parser function, simply import it into your project and
call it with a string containing the number you want to parse. You can also
specify a locale and options for the Intl.NumberFormat constructor, which
the function uses internally to format and parse numbers.
Here's an example of how to use the function:
import NumberParser from 'intl-number-parser';
const parser = NumberParser('en-US', { style: 'currency', currency: 'USD' });
const number = parser('$1,234.56'); // returns 1234.56
In this example, we create a new instance of the Intl-Number-Parser function
with the en-US locale and the currency style, which formats the number as
a currency with the USD currency code. We then call the function with a
string containing a currency-formatted number and get back the parsed
JavaScript number.
Contributions to the Intl-Number-Parser project are welcome and encouraged! If you find a bug or have an idea for a new feature, please open an issue on the project's GitHub page.
If you want to contribute code, please fork the repository and submit a pull request. Please make sure to write tests for any new code and ensure that all existing tests pass before submitting your pull request.
Intl-Number-Parser is free software licensed under the ISC License. Feel free to use it in your own projects or modify it as needed.
FAQs
Utility for parsing international numbers to native JavaScript numbers based on the locale
The npm package intl-number-parser receives a total of 2,039 weekly downloads. As such, intl-number-parser popularity was classified as popular.
We found that intl-number-parser demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.