0.1.5 • Published 7 years ago

parsejs v0.1.5

Weekly downloads
27
License
MIT
Repository
github
Last release
7 years ago

ParseJS

A library JS to format numbers and dates.

// Parse to currency string. Returns 'R$10,00'
parse(10.000).toCurrency();

// Parse to percent string with two decimal places. Returns '10,00%'
parse(10.000).toPercent(2);

// Parse to number string with two decimal places. Returns '10,00'
parse(10.000).toNumber();

// Parse to date object. Returns Wed Dec 10 2014
parse("10/12/2014").toDate();

Help and Support

See the documentation. Any questions, see the Issues.

Tests

First install the dependencies, then run npm tests:

$ npm install
$ npm tests

Run tests on browser

Run grunt tests-client:

$ grunt tests-client

Then open the URL to tests

License

MIT