rem: MochiKit.Format.numberFormatter = function (pattern, placeholder/* = "" */, locale/* = "default" */) {       if (typeof(placeholder) == "undefined") { placeholder = ""; } var match = pattern.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/); if (!match) { throw TypeError("Invalid pattern"); } var header = pattern.substr(0, match.index); var footer = pattern.substr(match.index + match[0].length); if (header.search(/-/) == -1) { header = header + "-"; } var whole = match[1]; var frac = (typeof(match[2]) == "string" && match[2] != "") ? match[2] : ""; var isPercent = (typeof(match[3]) == "string" && match[3] != ""); var tmp = whole.split(/,/); var separatorAt; if (typeof(locale) == "undefined") { locale = "default"; } if (tmp.length == 1) { separatorAt = null; } else { separatorAt = tmp[1].length; } var leadingZeros = whole.length - whole.replace(/0/g, "").length; var trailingZeros = frac.length - frac.replace(/0/g, "").length; var precision = frac.length; var rval = MochiKit.Format._numberFormatter( placeholder, header, footer, locale, isPercent, precision, leadingZeros, separatorAt, trailingZeros ); var m = MochiKit.Base; if (m) { var fn = arguments.callee; var args = m.concat(arguments); rval.repr = function () { return [ self.NAME, "(", map(m.repr, args).join(", "), ")" ].join(""); } } return rval; 
add: MochiKit.Format.numberFormatter=function(_242,_243,_244){ if(typeof (_243)=="undefined"){ _243=""; } var _245=_242.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/); if(!_245){ throw TypeError("Invalid pattern"); } var _246=_242.substr(0,_245.index); var _247=_242.substr(_245.index+_245[0].length); if(_246.search(/-/)==-1){ _246=_246+"-"; } var _248=_245[1]; var frac=(typeof (_245[2])=="string"&&_245[2]!="")?_245[2]:""; var _249=(typeof (_245[3])=="string"&&_245[3]!=""); var tmp=_248.split(/,/); var _251; if(typeof (_244)=="undefined"){ _244="default"; } if(tmp.length==1){ _251=null; }else{ _251=tmp[1].length; } var _252=_248.length-_248.replace(/0/g,"").length; var _253=frac.length-frac.replace(/0/g,"").length; var _254=frac.length; var rval=MochiKit.Format._numberFormatter(_243,_246,_247,_244,_249,_254,_252,_251,_253); var m=MochiKit.Base; if(m){ var fn=arguments.callee; var args=m.concat(arguments); rval.repr=function(){ return [self.NAME,"(",map(m.repr,args).join(", "),")"].join(""); 
context: MochiKit.Format.numberFormatter = function (pattern, placeholder/* = "" */, locale/* = "default" */) {    // http://java.sun.com/docs/books/tutorial/i18n/format/numberpattern.html    // | 0 | leading or trailing zeros    // | # | just the number    // | , | separator    // | . | decimal separator    // | % | Multiply by 100 and format as percent    if (typeof(placeholder) == "undefined") {        placeholder = "";    }    var match = pattern.match(/((?:[0#]+,)?[0#]+)(?:\.([0#]+))?(%)?/);    if (!match) {        throw TypeError("Invalid pattern");    }    var header = pattern.substr(0, match.index);    var footer = pattern.substr(match.index + match[0].length);    if (header.search(/-/) == -1) {        header = header + "-";    }    var whole = match[1];    var frac = (typeof(match[2]) == "string" && match[2] != "") ? match[2] : "";    var isPercent = (typeof(match[3]) == "string" && match[3] != "");    var tmp = whole.split(/,/);    var separatorAt;    if (typeof(locale) == "undefined") {        locale = "default";    }    if (tmp.length == 1) {        separatorAt = null;    } else {        separatorAt = tmp[1].length;    }    var leadingZeros = whole.length - whole.replace(/0/g, "").length;    var trailingZeros = frac.length - frac.replace(/0/g, "").length;    var precision = frac.length;    var rval = MochiKit.Format._numberFormatter(        placeholder, header, footer, locale, isPercent, precision,        leadingZeros, separatorAt, trailingZeros    );    var m = MochiKit.Base;    if (m) {        var fn = arguments.callee;        var args = m.concat(arguments);        rval.repr = function () {            return [                self.NAME,                "(",                map(m.repr, args).join(", "),                ")"            ].join("");        }    }    return rval;};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js