1.0.2 • Published 6 years ago

to-centesimal v1.0.2

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

to-centesimal

This is a little module that tries to convert units of currency (think dollars) into centesimal values.

Build status

Install

$ npm install to-centesimal

Usage

var cents = require('to-centesimal')

cents('$1.50')
=> 150
cents('£1.25')
=> 125
cents('£1')
=> 100
cents('€10.50')
=> 1050
cents('1¢')
=> 1
cents('1c')
=> 1

Page weight

compressionsize
to-centesimal.js2.36 kB
to-centesimal.min.js1.66 kB
to-centesimal.min.js.gz864 B

Caveats

The regular expression used is auto-generated from a list of countries’ currency symbols. I’m too lazy to research all of them, so please open an issue if notice something is amiss.

License

MIT

1.0.2

6 years ago

1.0.1

8 years ago

1.0.0

8 years ago