lib/number.js
function (format) {
            
            _validFormat(format);
            
            var fn = null;
            
            if (_formatFnAll.hasOwnProperty(format))
                fn = _formatFnAll[format];
            
            else {
                
                var m = _regexDecFormat.exec(format);
                if (m !== null)
                    fn = _getDecFormatter( (  (typeof m[3] === 'string')
                                             ? m[3].length
                                             : 0 ),
                                           (m[1] === '+'),
                                           (m[4] === '%') );
                else {
                    m = _regexFracFormat.exec(format);
                    if (m !== null)
                        fn = _getFractFormatter( parseInt(m[2], 10),
                                                 (m[1] === '+') );  // isPlus
                }
                
                _formatFnAll[format] = fn;
            }
            
            if (fn !== null)
                return fn;
            else  // Throw an exception every time
                throw "IllegalArgumentException: unsupported number format (" + format + ")";
        }
function (format) {
            
            _validFormat(format);
            
            var fn = null;
            
            if (_formatFnAll.hasOwnProperty(format))
                fn = _formatFnAll[format];
            
            else {
                
                var m = _regexDecFormat.exec(format);
                if (m !== null)
                    fn = _getDecFormatter( (  (typeof m[3] === 'string')
                                             ? m[3].length
                                             : 0 ),
                                           (m[1] === '+'),
                                           (m[4] === '%') );
                else {
                    m = _regexFracFormat.exec(format);
                    if (m !== null)
                        fn = _getFractFormatter( parseInt(m[2], 10),
                                                 (m[1] === '+') );  // isPlus
                }
                
                _formatFnAll[format] = fn;
            }
            
            if (fn !== null)
                return fn;
            else  // Throw an exception every time
                throw "IllegalArgumentException: unsupported number format (" + format + ")";
        }
function ( format ) { _validFormat ( format ) ; var fn = null ; if ( _formatFnAll . hasOwnProperty ( format ) ) fn = _formatFnAll [ format ] ; else { var m = _regexDecFormat . exec ( format ) ; if ( m !== null ) fn = _getDecFormatter ( ( ( typeof m [ 3 ] === 'string' ) ? m [ 3 ] . length : 0 ) , ( m [ 1 ] === '+' ) , ( m [ 4 ] === '%' ) ) ; else { m = _regexFracFormat . exec ( format ) ; if ( m !== null ) fn = _getFractFormatter ( parseInt ( m [ 2 ] , 10 ) , ( m [ 1 ] === '+' ) ) ; // isPlus
 } _formatFnAll [ format ] = fn ; } if ( fn !== null ) return fn ; else // Throw an exception every time
 throw "IllegalArgumentException: unsupported number format (" + format + ")" ; }
Returns a Function that formats numbers
into a 'string' value.

Examples:
Number.getFormatter("0.00")(5.125) == "5.13"
Number.getFormatter("0.0000")(5.125) == "5.1250"
Number.getFormatter("0'1/8")(5.125) == "5'1"

@param format {String}
@return {Function} A function that takes one 'number'
argument and converts it into a String value.
Returns a Function that formats numbers into a string value .