decpl
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Decpl Travis CI Build Status

Get the amount of decimal places in a number. (Based on https://stackoverflow.com/a/9539746/8384910)

NPM Badge

Install

npm install decpl

Usage

const decpl = require("decpl");

decpl(5555.0);
//=> 0

decpl(5555);
//=> 0

decpl(555.5);
//=> 1

decpl(555.50);
//=> 1

decpl(0.0000005);
//=> 7

decpl(5e-7);
//=> 7

decpl(0.00000055);
//=> 8

decpl(5.5e-7);
//=> 8

API

decpl(number)

number

Type: number

The number to process.

Package Sidebar

Install

npm i decpl

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

3.98 kB

Total Files

6

Last publish

Collaborators

  • richienb