https://github.com/nothingrandom/leadingzero
Add leading zeros to a number or string
https://github.com/nothingrandom/leadingzero
Last synced: 3 months ago
JSON representation
Add leading zeros to a number or string
- Host: GitHub
- URL: https://github.com/nothingrandom/leadingzero
- Owner: nothingrandom
- License: mit
- Created: 2020-02-14T11:22:29.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T09:04:43.000Z (9 months ago)
- Last Synced: 2025-03-19T03:59:04.423Z (4 months ago)
- Language: JavaScript
- Size: 1.3 MB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# leadingzero

> Add leading zeros to a number or string## Install
``` bash
$ yarn add leadingzero
$ npm install leadingzero
```## Usage (ES6 imports)
``` js
import leadingzero from 'leadingzero';// leadingzero(number, zeros, character)
leadingzero(7, 3);
// => '007'leadingzero('10', 4);
// => '0010'leadingzero(1234, 2);
// => '1234'
```## License
MIT © [Benjamin Grant](https://nothingrandom.com)