1.0.1 • Published 9 years ago

us-dollars v1.0.1

Weekly downloads
35
License
MIT
Repository
github
Last release
9 years ago

us-dollars Build Status

Format US dollars ($)

Install

$ npm install --save us-dollars

Usage

var dollars = require('us-dollars')

dollars(5)
//=> $5.00

dollars(5, 0)
//=> $5

dollars(5.1234)
//=> $5.1234

API

dollars(value, [decimals]) -> string

value

Required
Type: value

A number to format.

decimals

Type: number

A number of decimal places to use. When omitted, this defaults to 2 or the precision of value, whichever is greatest.

License

MIT © Ben Drucker