Roo.util.Math = function(num, precision, roundType){
- var i;
- if(num instanceof Roo.util.Math){
- var o = this;
- for(i in {precision: 0, roundType: 0, _s: 0, _f: 0}) o[i] = num[i];
- this._d = num._d.slice();
- return;
- }
-
- this.precision = isNaN(precision = Math.abs(precision)) ? Roo.util.Math.defaultPrecision : precision;
- this.roundType = isNaN(r = Math.abs(roundType)) ? Roo.util.Math.defaultRoundType : roundType;
-
- this._s = (num += "").charAt(0) == "-";
- this._f = (
- (num = num.replace(/[^\d.]/g, "").split(".", 2))[0] = num[0].replace(/^0+/, "") || "0"
- ).length;
- for(i = (num = this._d = (num.join("") || "0").split("")).length; i; num[--i] = +num[i]);
- this.round();
+ this._constructor(num,precision, roundType);
};
Roo.util.Math.ROUND_HALF_EVEN = (Roo.util.Math.ROUND_HALF_DOWN = (Roo.util.Math.ROUND_HALF_UP =