Methods
(static) padZeroes(num, minLength) → {string}
Parameters:
Name | Type | Description |
---|---|---|
num |
number | The number being padded. |
minLength |
integer | How minimum length of the final number. |
Returns:
The passed number, prepended with any extra zeroes needed to reach minLength.
- Type
- string
Examples
padZeroes(1, 2); // "01"
padZeroes(15, 2); // "15"
padZeroes(12, 3); // "012"
(static) roundNumber(num, minLength) → {number}
Parameters:
Name | Type | Description |
---|---|---|
num |
number | The number being padded. |
minLength |
integer | How minimum length of the final number. |
Returns:
The passed number, rounded to the passed number of places.
- Type
- number
Examples
roundNumber(1.1426, 2); // 1.14
roundNumber(1.1426, 3); // 1.143