* Pads number with zeros until it's length is the same as given length. * * @param {Number} number Number to pad. * @param {Number} length Max string length with. * @return {String} Returns a string padded with proper amount of '0'.
(number, length)
| 831 | * @return {String} Returns a string padded with proper amount of '0'. |
| 832 | */ |
| 833 | function padNumber(number, length) |
| 834 | { |
| 835 | var result = number.toString(); |
| 836 | |
| 837 | while (result.length < length) |
| 838 | result = '0' + result; |
| 839 | |
| 840 | return result; |
| 841 | }; |
| 842 | |
| 843 | /** |
| 844 | * Replaces tabs with spaces. |