| @@ 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)) |
|
| @@ 652-657 (lines=6) @@ | ||
| 649 | static public function number_format($number,$num_decimal_places=2,$readonly=true) |
|
| 650 | { |
|
| 651 | static $dec_separator=null,$thousands_separator=null; |
|
| 652 | if (is_null($dec_separator)) |
|
| 653 | { |
|
| 654 | $dec_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][0]; |
|
| 655 | if (empty($dec_separator)) $dec_separator = '.'; |
|
| 656 | $thousands_separator = $GLOBALS['egw_info']['user']['preferences']['common']['number_format'][1]; |
|
| 657 | } |
|
| 658 | if ((string)$number === '') return ''; |
|
| 659 | ||
| 660 | return number_format(str_replace(' ','',$number),$num_decimal_places,$dec_separator,$readonly ? $thousands_separator : ''); |
|