simple-zeropad

1.0.5 • Public • Published

simple-zeropad Build Status

Zeropad your positive integers.

simple-zeropad is amazing

For custom-length zeropadding, see zeropad.

Install

$ npm install simple-zeropad

Usage

var zeropad = require('simple-zeropad');
 
zeropad(9);
// => '09'
 
zeropad(0);
// => '00'
 
zeropad(10);
// => '10'
 

Amazing, right?

Motivation

This is an incredibly simple module, but I have lost count over the years how many times I have written a function to zeropad my numbers for various user-interface purposes, so the motivation to build this module is one of pure principle, posterity, and a mission to modularize. Please enjoy this module and the 20 seconds of blood, sweat and tears I poured into this.

Related

  • zeropad: pad to any custom length

License

MIT @ Michael Wuergler

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.5
    128
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.5
    128
  • 1.0.4
    1
  • 1.0.3
    2

Package Sidebar

Install

npm i simple-zeropad

Weekly Downloads

131

Version

1.0.5

License

MIT

Last publish

Collaborators

  • radiovisual