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

usd-formatter

1.0.1 • Public • Published

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: '$',
})

Install

npm i usd-formatter

DownloadsWeekly Downloads

12

Version

1.0.1

License

MIT

Unpacked Size

253 kB

Total Files

9

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar