Index: trunk/core/kernel/utility/formatters/formatter.php =================================================================== diff -u -r4758 -r6583 --- trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 4758) +++ trunk/core/kernel/utility/formatters/formatter.php (.../formatter.php) (revision 6583) @@ -20,6 +20,17 @@ $type_ok = preg_match('#int|integer|double|float|real|numeric|string#', $field_type); if($field_type == 'string') return $value; + static $comma = null; + static $thousands = null; + if (is_null($comma) || is_null($thousands)) { + $lang =& $this->Application->recallObject('lang.current'); + $comma = $lang->GetDBField('DecimalPoint'); + $thousands = $lang->GetDBField('ThousandSep'); + } + + $value = str_replace($thousands, '', $value); + $value = str_replace($comma, '.', $value); + if ($value != '' && $type_ok) { $ret = is_numeric($value); @@ -43,10 +54,17 @@ $options = $object->GetFieldOptions($field_name); if ( isset($format) ) $options['format'] = $format; $tc_value = $this->TypeCast($value,$options); - if( ($tc_value === false) || ($tc_value != $value) ) return $value; // for leaving badly formatted date on the form + if( ($tc_value === false) || ("$tc_value" != "$value") ) return $value; // for leaving badly formatted date on the form - if (isset($options['format'])) return sprintf($options['format'], $tc_value); + if (isset($options['format'])) { + $tc_value = sprintf($options['format'], $tc_value); + } + if (preg_match('#int|integer|double|float|real|numeric#', $options['type'])) { + $lang =& $this->Application->recallObject('lang.current'); + return $lang->formatNumber($tc_value); + } + return $tc_value; }