Novice, Practiced, Mastered
    Have ideas to improve npm?Join in the discussion! »

    zero-fill

    2.2.4 • Public • Published

    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.

    Install

    npm i zero-fill

    DownloadsWeekly Downloads

    50,920

    Version

    2.2.4

    License

    MIT

    Unpacked Size

    4.91 kB

    Total Files

    6

    Last publish

    Collaborators

    • avatar