Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
format-money-js
Advanced tools
Tiny JavaScript library (656 bytes) by CurrencyRate.today, providing simple and advanced number, money and currency formatting.
Tiny JavaScript library (656 bytes) by CurrencyRate.today, providing simple and advanced number, money and currency formatting.
const { FormatMoney } = require('format-money-js');
const fm = new FormatMoney({
decimals: 2
});
console.log(fm.from(12345.67, { prefix: '$' })); // $12,345.67
You can added options in construct of class and in method. But method will be primary.
const fm = new FormatMoney({ prefix: '$' });
console.log(fm.from(12345.67, { prefix: '€' })); // €12,345.67
Name | Default | Type | Example |
---|---|---|---|
grouping | true | Boolean | 1,000 (true) vs 1000 (false) |
separator | , | String | 1,000 |
decimalPoint | . | String | 1,234.56 |
decimals | 0 | Number | 1,234 (0 - without decimals) |
prefix | None | String | $1,234.56 (before) |
suffix | None | String | 1,234.56$ (after) |
FAQs
Zero dependency tiny JavaScript library (1kB bytes) by CurrencyRate.today, providing simple way and advanced number, money and currency formatting and removes all formatting/cruft and returns the raw float value.
The npm package format-money-js receives a total of 2,710 weekly downloads. As such, format-money-js popularity was classified as popular.
We found that format-money-js 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.