@@ 397-402 (lines=6) @@ | ||
394 | foreach((array)$fields['float'] as $name) |
|
395 | { |
|
396 | static $dec_separator,$thousands_separator; |
|
397 | if (is_null($dec_separator)) |
|
398 | { |
|
399 | $dec_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][0]; |
|
400 | if (empty($dec_separator)) $dec_separator = '.'; |
|
401 | $thousands_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][1]; |
|
402 | } |
|
403 | if($record->$name && (string)$record->$name != '') |
|
404 | { |
|
405 | if(!is_numeric($record->$name)) |
@@ 707-712 (lines=6) @@ | ||
704 | static public function number_format($number,$num_decimal_places=2,$readonly=true) |
|
705 | { |
|
706 | static $dec_separator=null,$thousands_separator=null; |
|
707 | if (is_null($dec_separator)) |
|
708 | { |
|
709 | $dec_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][0]; |
|
710 | if (empty($dec_separator)) $dec_separator = '.'; |
|
711 | $thousands_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][1]; |
|
712 | } |
|
713 | if ((string)$number === '') return ''; |
|
714 | ||
715 | return number_format(str_replace(' ','',$number),$num_decimal_places,$dec_separator,$readonly ? $thousands_separator : ''); |