to-percentage-by
Convert a Float number to percentage with rounding, ceiling or flooring.
Installation
$ npm install to-percentage-by --save
Usage
; // defaultToPercentageBy equals to toPercentageBy() var toPercentage = ;t;t; var toPercentage = ;t; var toPercentage = ;t; var toPercentage = ;t;
API
type string; : ToPercentage
Property
Value | Default | Notes |
---|---|---|
digits | 2 | The number of digits to appear after the decimal point |
method | Math.round | Could be Math.round , Math.ceil or Math.floor method |
float | The number to be converted. |
Test
$ npm run lint
$ npm run test:watch
CONTRIBUTING
- ⇄ Pull requests and ★ Stars are always welcome.
- For bugs and feature requests, please create an issue.
- Pull requests must be accompanied by passing automated tests (
$ npm test
).