Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nothingrandom/leadingzero
Add leading zeros to a number or string
https://github.com/nothingrandom/leadingzero
Last synced: 17 days 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-09-24T09:04:43.000Z (about 2 months ago)
- Last Synced: 2024-10-06T23:21:29.817Z (about 1 month ago)
- Language: JavaScript
- Size: 1.3 MB
- Stars: 3
- Watchers: 3
- Forks: 1
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# leadingzero
![Travis (.com)](https://img.shields.io/travis/com/nothingrandom/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)