Removed Unwanted Functions

Removed unnecessary functions, features are present in other two submitted functions.
This commit is contained in:
Michael Goldspinner
2018-01-13 10:12:48 -05:00
parent 1ca07eb961
commit e12369f077
2 changed files with 0 additions and 27 deletions

View File

@ -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"
```

View File

@ -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"
```