MCPcopy Create free account
hub / github.com/RubyLouvre/anu / toPaddedString

Function toPaddedString

test/json3.js:314–318  ·  view source on GitHub ↗
(width, value)

Source from the content-addressed store, hash-verified

312 // length is at least equal to `width`. The `width` must be <= 6.
313 var leadingZeroes = "000000";
314 var toPaddedString = function (width, value) {
315 // The `|| 0` expression is necessary to work around a bug in
316 // Opera <= 7.54u2 where `0 == -0`, but `String(-0) !== "0"`.
317 return (leadingZeroes + (value || 0)).slice(-width);
318 };
319
320 // Internal: Serializes a date object.
321 var serializeDate = function (value) {

Callers 2

serializeDateFunction · 0.85
escapeCharFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected