MCPcopy Create free account
hub / github.com/FastLED/FastLED / zeroPad

Function zeroPad

ci/docker_utils/avr8js/format-time.ts:1–7  ·  view source on GitHub ↗
(value: number, length: number)

Source from the content-addressed store, hash-verified

1function zeroPad(value: number, length: number) {
2 let sval = value.toString();
3 while (sval.length < length) {
4 sval = `0${sval}`;
5 }
6 return sval;
7 }
8
9 export function formatTime(seconds: number) {
10 const ms = Math.floor(seconds * 1000) % 1000;

Callers 1

formatTimeFunction · 0.85

Calls 1

toStringMethod · 0.80

Tested by

no test coverage detected