diff --git a/snippets/maintainDigits.md b/snippets/maintainDigits.md deleted file mode 100644 index 8b6c8dc18..000000000 --- a/snippets/maintainDigits.md +++ /dev/null @@ -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" -``` \ No newline at end of file diff --git a/snippets/to12HourFormat.md b/snippets/to12HourFormat.md deleted file mode 100644 index c58a9eda3..000000000 --- a/snippets/to12HourFormat.md +++ /dev/null @@ -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" -``` \ No newline at end of file