lib/Ext/util/Format.js
function (val, size, ch) {
        var result = String(val);
        ch = ch || " ";
        while (result.length < size) {
            result = ch + result;
        }
        return result;
    }
function (val, size, ch) {
        var result = String(val);
        ch = ch || " ";
        while (result.length < size) {
            result = ch + result;
        }
        return result;
    }
Pads the left side of a string with a specified character.  This is especially useful
for normalizing number and date strings.  Example usage:

var s = Ext.util.Format.leftPad('123', 5, '0');
// s now contains the string: '00123'

@param {String} string The original string.
@param {Number} size The total length of the output string.
@param {String} [char=' '] (optional) The character with which to pad the original string.
@return {String} The padded string.