JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 29867
  • Score
    100M100P100Q187000F
  • License MIT

Zero-fill a number to the given size.

Package Exports

  • zero-fill

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (zero-fill) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

zero-fill travis npm downloads javascript style guide

Zero-fill a number to the given size.

zero

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.