
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-to-float
Advanced tools
The currency-to-float
package is a dependency-free utility designed to convert currency values into numerical representations without the need to specify the source currency.
You can install currency-to-float
using npm or any other package manager:
npm install currency-to-float
import currencyToFloat from 'currency-to-float';
// Or use CommonJs:
// const { parse } = require('currency-to-float');
const value = currencyToFloat('$12.50 USD');
console.log(value); // 12.5
Currency | Locale | Input (string) | Output (Number) |
---|---|---|---|
US Dollar ($, USD) | en-US | $12.50 USD | 12.5 |
Brazilian Real (R$, BRL) | pt-BR | R$ 12,50 | 12.5 |
Canadian Dollar ($, CAD) | en-CA | $12.50 CAD | 12.5 |
Canadian Dollar ($, CAD) | fr-CA | 12,50 $ CAD | 12.5 |
Australian Dollar ($, AUD) | en-AU | $12.50 AUD | 12.5 |
Euro (€, EUR) | de-DE, fr-FR | 12,50 € EUR | 12.5 |
Euro (€, EUR) | en-IE | €12.50 EUR | 12.5 |
Euro (€, EUR) | nl-NL | €12,50 EUR | 12.5 |
British Pounds (£, GBP) | en-GB | £12.50 GBP | 12.5 |
Japanese Yen (¥, JPY) | ja-JP | ¥1250 JPY | 1250 |
New Zealand Dollar ($, NZD) | en-NZ | $12.50 NZD | 12.5 |
Hong Kong Dollar ($, HKD) | zh-HK | $12.50 HKD | 12.5 |
Singapore Dollar ($, SGD) | zh-SG | $12.50 SGD | 12.5 |
Danish Krone (Kr, DKK) | da-DK | 12,50 kr. DKK | 12.5 |
Run locally with npm run benchmark
currencyToFloat x 235,939 ops/sec ±1.10% (92 runs sampled)
currency.js x 204,132 ops/sec ±2.87% (89 runs sampled)
Fastest is currencyToFloat
This package is open-source and available under the MIT License.
FAQs
Parse any currency
The npm package currency-to-float receives a total of 16 weekly downloads. As such, currency-to-float popularity was classified as not popular.
We found that currency-to-float demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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
/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.