actually i wanted it to a "fixed" two decimal value of 100000 of a cent accuracy, this is how i did it:
Code:
function t2(v){
tmpv = v;
suffix = ""
do0 = false;
if(Math.round(v) == v){
suffix = ".00";
res = v+suffix;
return res;
}else{
v = v+"";
tmpy = v.indexOf(".");
if(tmpy+6 < v.length){
tmpRem = v.substring(tmpy, tmpy+6);
tmpz = Math.floor(v);
return tmpz+".00";
}
}
tmpv = tmpv * 100;
tmpv = Math.round(tmpv);
if(tmpv % 10 == 0 || tmpv % -10 == 0){
do0 = true;
}
tmpv = tmpv / 100;
if(do0){
tmpv = tmpv + "0";
}
return tmpv;
}
unfortunately, or fortunately, after writing that i discovered this function:
Code:
var x = 16.000000000000001;
alert(x.toFixed(2));
hmm, oh well

at least that was only a small section of what i had to do, the code wasn't a waste.