function tozero1(t) { return ("" + t).length < 2 ? "0" + ("" + t) : ("" + t); } function tozero2(t) { return "00".slice(("" + t).length) + ("" + t); }
these functions do: "6"-> "06" "11"-> "11" etc.
function tozero1(t) { return ("" + t).length < 2 ? "0" + ("" + t) : ("" + t); } function tozero2(t) { return "00".slice(("" + t).length) + ("" + t); }
these functions do: "6"-> "06" "11"-> "11" etc.
Comments
Post a Comment