Removed Unwanted Functions
Removed unnecessary functions, features are present in other two submitted functions.
This commit is contained in:
@ -1,14 +0,0 @@
|
|||||||
### setDigits
|
|
||||||
|
|
||||||
Uses `String.padStart()` or `String.padEnd()` to maintain digit length of a provided integer. Returns stringified integer.
|
|
||||||
|
|
||||||
Control direction (0 = before integer, 1 = after integer).
|
|
||||||
|
|
||||||
```js
|
|
||||||
const setDigits = ( num=0, len=1, direction=0 ) => {
|
|
||||||
return direction > 0 ? num.toString().padStart(len, "0") : num.toString().padEnd(len, "0");
|
|
||||||
}
|
|
||||||
// setDigits(1, 2, 0) -> "10"
|
|
||||||
// setDigits(1, 2, 1) -> "01"
|
|
||||||
// setDigits(11, 2, 1) -> "11"
|
|
||||||
```
|
|
||||||
@ -1,13 +0,0 @@
|
|||||||
### to12Hour
|
|
||||||
|
|
||||||
Uses the modulo operator (`%`) to transform an integer to a 12 hour clock format.
|
|
||||||
|
|
||||||
```js
|
|
||||||
const to12Hour = ( num ) => {
|
|
||||||
|
|
||||||
return num === 0 || num === 12 || num === 24 ? 12 : num % 12;
|
|
||||||
}
|
|
||||||
// to12Hour(9) -> "9"
|
|
||||||
// to12Hour(9) -> "9"
|
|
||||||
// to12Hour(13) -> "1"
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user