leadingzero
TypeScript icon, indicating that this package has built-in type declarations

1.1.2 • Public • Published

leadingzero

Travis (.com)

Add leading zeros to a number or string

Install

$ yarn add leadingzero
$ npm install leadingzero

Usage (ES6 imports)

import leadingzero from 'leadingzero';
 
// leadingzero(number, zeros, character)
 
leadingzero(7, 3);
// => '007'
 
leadingzero('10', 4);
// => '0010'
 
leadingzero(1234, 2);
// => '1234'

License

MIT © Benjamin Hollway

/leadingzero/

    Package Sidebar

    Install

    npm i leadingzero

    Weekly Downloads

    53

    Version

    1.1.2

    License

    MIT

    Unpacked Size

    4.58 kB

    Total Files

    9

    Last publish

    Collaborators

    • nothingrandom