MCPcopy
hub / github.com/TiddlyWiki/TiddlyDesktop / pad

Function pad

source/js/utils/saving.js:69–76  ·  view source on GitHub ↗
(value,length)

Source from the content-addressed store, hash-verified

67Pad a string to a given length with "0"s. Length defaults to 2
68*/
69function pad(value,length) {
70 length = length || 2;
71 var s = value.toString();
72 if(s.length < length) {
73 s = "000000000000000000000000000".substr(0,length - s.length) + s;
74 }
75 return s;
76};
77
78/*
79 * Returns an escape sequence for given character. Uses \x for characters <=

Callers 1

escapeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected