Project

General

Profile

Bug #20288 » 10861.diff

Administrator Admin, 2009-04-07 11:50

View differences:

t3lib/class.t3lib_tcemain.php (working copy)
}
break;
case 'double2':
$theDec = 0;
for ($a=strlen($value); $a>0; $a--) {
if (substr($value,$a-1,1)=='.' || substr($value,$a-1,1)==',') {
$theDec = substr($value,$a);
$value = substr($value,0,$a-1);
break;
}
}
$theDec = ereg_replace('[^0-9]','',$theDec).'00';
$value = intval(str_replace(' ','',$value)).'.'.substr($theDec,0,2);
$value = str_replace(',', '.', $value);
$value = number_format($value, 2, '.', '');
break;
case 'md5':
if (strlen($value)!=32){$set=false;}
t3lib/jsfunc.evalfield.js (working copy)
}
function evalFunc_parseDouble(value) {
var theVal = ''+value;
var dec=0;
if (!value) return 0;
for (var a=theVal.length; a>0; a--) {
if (theVal.substr(a-1,1)=='.' || theVal.substr(a-1,1)==',') {
dec = theVal.substr(a);
theVal = theVal.substr(0,a-1);
break;
}
theVal = Number(theVal.replace(/,/g, "."));
if(!theVal) {
theVal = 0;
}
dec = this.getNumChars(dec)+'00';
theVal=this.parseInt(this.noSpace(theVal))+TS.decimalSign+dec.substr(0,2);
theVal = theVal.toFixed(2);
return theVal;
}
(1-1/3)