MCPcopy Create free account
hub / github.com/acode/cli / formatDigits

Function formatDigits

cli/commands/user.js:11–17  ·  view source on GitHub ↗
(num, figs)

Source from the content-addressed store, hash-verified

9const config = require('../config.js');
10
11let formatDigits = (num, figs) => {
12
13 num = (parseInt(Math.max(num, 0)) || 0).toString();
14 let zeroes = Math.max(figs - num.length, 0);
15 return `${Array(zeroes + 1).join('0')}${num}`;
16
17};
18
19let formatDate = function(str) {
20

Callers 1

formatDateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected