1.0.3 • Published 8 years ago

digit-count v1.0.3

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

Build Status

Digit Counter

Counts the digits in a decimal number.

Installation

npm install digit-count

Usage

digit-count(1234); // returns 4
digit-count('1234'); // 4
digit-count(-1234); // 4, again
digit-count(1234.2232); // still returns 4

// but!
digit-count('abcd'); // throws a type error

Attribution

Adopted from Mwr247's elegant solution to this problem, which can be found here.