1.0.1 • Published 6 years ago

usd-formatter v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

USD Formatter

Lightweight number to currency formatter. Accepts any kind of string or number and formats it to a USD string.

Installation

$ npm i -S usd-formatter

Usage

const formatter = require('usd-formatter')

let currency = formatter(12345678.9)
console.log(currency)

// Logs "$12,345,678.90"

Options

The following options can be passed for the second argument.

formatter(12345678.9, {
	prepend: '$',
})
1.0.1

6 years ago

1.0.0

6 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago