rem: MochiKit.Format.twoDigitFloat = function (someFloat) { /***  Roughly equivalent to: sprintf("%.2f", someFloat)  ***/ var sign = (someFloat < 0 ? '-' : ''); var s = Math.floor(Math.abs(someFloat) * 100).toString(); if (s == '0') { return s; } if (s.length < 3) { while (s.charAt(s.length - 1) == '0') { s = s.substring(0, s.length - 1); } return sign + '0.' + s; } var head = sign + s.substring(0, s.length - 2); var tail = s.substring(s.length - 2, s.length); if (tail == '00') { return head; } else if (tail.charAt(1) == '0') { return head + '.' + tail.charAt(0); } else { return head + '.' + tail; } 
add: MochiKit.Format.twoDigitFloat=function(_259){ var sign=(_259<0?"-":""); var s=Math.floor(Math.abs(_259)*100).toString(); if(s=="0"){ return s; } if(s.length<3){ while(s.charAt(s.length-1)=="0"){ s=s.substring(0,s.length-1); } return sign+"0."+s; } var head=sign+s.substring(0,s.length-2); var tail=s.substring(s.length-2,s.length); if(tail=="00"){ return head; }else{ if(tail.charAt(1)=="0"){ return head+"."+tail.charAt(0); }else{ return head+"."+tail; } } 
context: MochiKit.Format.twoDigitFloat = function (someFloat) {    /***        Roughly equivalent to: sprintf("%.2f", someFloat)    ***/    var sign = (someFloat < 0 ? '-' : '');    var s = Math.floor(Math.abs(someFloat) * 100).toString();    if (s == '0') {        return s;    }    if (s.length < 3) {        while (s.charAt(s.length - 1) == '0') {            s = s.substring(0, s.length - 1);        }        return sign + '0.' + s;    }    var head = sign + s.substring(0, s.length - 2);    var tail = s.substring(s.length - 2, s.length);    if (tail == '00') {        return head;    } else if (tail.charAt(1) == '0') {        return head + '.' + tail.charAt(0);    } else {        return head + '.' + tail;    }};
meta: 8607	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8607/ad067b3f5d648d6df90ec6fb2b79f0027612a307/MochiKit.js/buggy/trunk/lib/MochiKit.js