1.0.2 • Published 5 years ago

to-dollars v1.0.2

Weekly downloads
8
License
MIT
Repository
github
Last release
5 years ago

to-dollars

A JavaScript utility function for formatting numbers as dollars

Installation

In a browser:

<script src="index.js"></script>

Using npm:

$ npm install --save to-dollars

Or yarn:

$ yarn add to-dollars

In Node.js:

var toDollars = require('to-dollars');

Example

toDollars(0)
//=> $0.00

toDollars(0.009)
//=> $0.01

toDollars(1000000000)
//=> $1,000,000,000.00

toDollars('hello world')
// => undefined

toDollars('1234')
// => $1,234.00
1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.3.0

5 years ago

0.2.0

5 years ago

0.1.0

5 years ago