(value,length)
| 67 | Pad a string to a given length with "0"s. Length defaults to 2 |
| 68 | */ |
| 69 | function 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 <= |