MCPcopy Create free account
hub / github.com/GamerHack/GamerHack.github.io / zeroFill

Function zeroFill

restore/900v3/int64.js:79–87  ·  view source on GitHub ↗
(number, width)

Source from the content-addressed store, hash-verified

77}
78
79function zeroFill(number, width) {
80 width -= number.toString().length;
81
82 if (width > 0) {
83 return new Array(width + (/\./.test(number) ? 2 : 1)).join('0') + number;
84 }
85
86 return number + ""; // always return a string
87}
88
89function zeroFill(number, width) {
90 width -= number.toString().length;

Callers 1

int64Function · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected