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

format-money-js

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

format-money-js

Tiny JavaScript library (656 bytes) by CurrencyRate.today, providing simple and advanced number, money and currency formatting.

  • 1.1.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2.7K
decreased by-29.14%
Maintainers
1
Weekly downloads
 
Created
Source

format-money-js

Build Status version download per month

Tiny JavaScript library (656 bytes) by CurrencyRate.today, providing simple and advanced number, money and currency formatting.

Example

const { FormatMoney } = require('format-money-js');

const fm = new FormatMoney({
  decimals: 2
});

console.log(fm.from(12345.67, { prefix: '$' })); // $12,345.67

Options

NameDefaultTypeExample
groupingtrueBoolean1,000 (true) vs 1000 (false)
separator,String1,000
decimalPoint.String1,234.56
decimals0Number1,234 (0 - without decimals)
prefixNoneString$1,234.56 (before)
suffixNoneString1,234.56$ (after)

You can added options in construct of class and in method. But method will be primary.

Example:

const fm = new FormatMoney({ prefix: '$' });

console.log(fm.from(12345.67, { prefix: '€' })); // €12,345.67

Thank you

https://currencyrate.today/

Keywords

FAQs

Package last updated on 27 Jan 2020

Did you know?

Socket

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.

Install

Related posts

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