Miss any of our Open RFC calls?Watch the recordings here! »

usd-please

1.0.5 • Public • Published

CircleCI styled with prettier minified

usd-please

Its only job is to transform integers/decimals into USD currency format. The production compilation weighs in at approximately 900 bytes!

Installation:

npm i -S usd-please@latest

Usage:

usd(figureToBeFormatted: number, returnDollarsAndCents: boolean) => string | undefined

Example with cents:

const usd = require('usd-please')
const dollars = 1234.56
const formattedDollars = usd(dollars, true)

console.log(`$${formattedDollars}`)
// =>  $1,234.56

Example without cents:

const usd = require('usd-please')
const dollars = 1234.56
const formattedDollars = usd(dollars)

console.log(`$${formattedDollars}`)
// =>  $1,235

Install

npm i usd-please

DownloadsWeekly Downloads

3

Version

1.0.5

License

ISC

Last publish

Collaborators

  • avatar