MCPcopy Index your code
hub / github.com/acode/cli / zeroPad

Function zeroPad

cli/tabler.js:8–13  ·  view source on GitHub ↗
(n, l, s)

Source from the content-addressed store, hash-verified

6}
7
8function zeroPad (n, l, s) {
9 s = s === undefined ? '0' : s;
10 n = n.toString();
11 let delta = Math.max(0, l - n.length);
12 return Array(delta + 1).join(s) + n;
13}
14
15function formatDate (dt) {
16 dt = dt instanceof Date ? dt : new Date(dt);

Callers 1

formatDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected