number-to-money

1.0.7 • Public • Published

number-to-money

Version License

A lightweight and simple plugin to convert number to money format.

Installation

npm install number-to-money

or

yarn add number-to-money

Usage

Javascript

Simply use toMoney function to convert any number to money format. You'll need to add manually the currency. This plugin will add it automatically in future releases.

import toMoney from 'number-to-money';

const number = 3000000.3;
const moneyFormat = toMoney(number);

console.log(moneyFormat);
Output

3,000,000.30

Donations

Donations are greatly appreciated!

BUY ME A COFFEE

Package Sidebar

Install

npm i number-to-money

Weekly Downloads

1

Version

1.0.7

License

MIT

Unpacked Size

1.64 kB

Total Files

3

Last publish

Collaborators

  • danielfranco