zero-padding
v1.0.0
Published
Zero padding for number at JavaScript
Downloads
9
Readme
Zero-padding
Zero padding for number at JavaScript
Usage
html
<script src="dist/zero-padding.js"></script>
npm
Install to project
$ npm i -D zero-padding
Write to javascript files
import ZeroPadding from 'zero-padding'
Document
ZeroPadding(num, digit)
argument
param | type | description --- | --- | --- num | number | number you want to zero padding in digit | number | include digit number of zero padding
return
string
example
var num1 = ZeroPadding(10, 3) //-> '010'
var num2 = ZeroPadding(-10, 5) //-> '-00010'
var num3 = ZeroPadding(100, 2) //-> '100' no zero padding