Add a leading zero to a number.
Via npm:
$ npm install add-zero --save
Via Bower:
$ bower install add-zero --save
var addZero = require('add-zero');
addZero(5); // 05
addZero(10); // 10
addZero(5, 3); // 005
addZero(100, 3); // 100
addZero(-5); // -05
addZero(-5, 3); // -005
Type: number
(integer) or string
Value in which a leading zero should be added to.
Type: number
Default: 2
Total number of digits or decimal places.
MIT © Rafael Rinaldi