Actions
Bug #20288
closedEval of double2 doesn't work
Start date:
2009-04-07
Due date:
% Done:
0%
Estimated time:
TYPO3 Version:
4.3
PHP Version:
5.3
Tags:
Complexity:
Is Regression:
Sprint Focus:
Description
If a field has eval double2 it should be result in a double with precision 2. This works for most values, but some not.
Example:
-1,75 => -1.75
12 => 12.00
but
0,75 => 0.75,5 => 0.50
It's not possible to enter a value between -1 and 0
(issue imported from #M10861)
Files
Updated by Steffen Kamper over 15 years ago
php-validation can be very simple:
$value = str_replace(',', '.', trim($value));
return number_format($value, 2, '.', '');
Updated by Steffen Kamper over 15 years ago
the same for JS:
var theVal = ''+value;
theVal = Number(theVal.replace(/,/g, "."));
theVal = theVal.toFixed(2);
return theVal;
Updated by Steffen Kamper over 15 years ago
committed to trunk, rev 5460 and 4_2, rev 5461
Actions