
Security News
/Research
Wallet-Draining npm Package Impersonates Nodemailer to Hijack Crypto Transactions
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
currency-formatting
Advanced tools
Package to help you format numbers as currency and visa versa
A small package that converts a number to currency format and visa versa.
Using cdn:
<script src="https://cdn.rawgit.com/tidupls/currency-format/master/dist/currency-format.min.js"></script>
Using npm:
$ npm install --save currency-formatting
Using bower:
$ bower install currency-formatting
// Returns a formatted string.
// The number is formatted based on symbol, precision, decimal, thousand & format provided.
currency.format(5) // R 5.00
currency.format(500.555, '$') // $ 500.56
currency.format(4999.99, '€', 2, '.', ',') // € 4.999,99
// Returns a number for the string provided.
currency.unformat('$ 500,00', ',') // 500
currency.unformat('£ 12,345,678.90 GBP', '.'); // 12345678.9
Has two public methods:
format(number, symbol, precision, thousand, decimal, format)
unformat(value, decimal)
and a global settings object with defaults of:
var settings = {
symbol: "$", // default currency symbol
format: "_s _v", // format of currency _s = symbol & _v = value
decimal: ".", // decimal point separator
thousand: ",", // thousand separator
precision: 2, // decimal places
}
$ npm run test
FAQs
Package to help you format numbers as currency and visa versa
The npm package currency-formatting receives a total of 3 weekly downloads. As such, currency-formatting popularity was classified as not popular.
We found that currency-formatting demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.
Security News
/Research
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.