Name Last Update
..
test Loading commit data...
.npmignore Loading commit data...
.travis.yml Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
index.js Loading commit data...
package.json Loading commit data...

zero-fill build version

Zero-fill a number to the given size.

zero

browser support

install

npm install zero-fill

usage

var zeroFill = require('zero-fill')

zeroFill(4, 1) // '0001'
zeroFill(10, 55) // '0000000055'
zeroFill(1, 1) // '1'

Partial application:

zeroFill(4)(1) // '0001'

Custom padding character:

zeroFill(4, 55, ' ')  // '  55'
zeroFill(4, 500, ' ') // ' 500'

license

MIT. Copyright (c) Feross Aboukhadijeh.