Added global currency format settings in $conf array.
| | |
| | | $conf['language'] = '{language}'; |
| | | $conf['debug_language'] = false; |
| | | |
| | | //** Currency format |
| | | $conf['number_format_decimals'] = 2; |
| | | $conf['number_format_dec_point'] = ','; |
| | | $conf['number_format_thousands_sep'] = ''; |
| | | |
| | | |
| | | //** Misc. |
| | | $conf['interface_logout_url'] = ''; // example: http://www.domain.tld/ |
| | |
| | | break; |
| | | |
| | | case 'CURRENCY': |
| | | $record[$key] = number_format($record[$key], 2, ',', ''); |
| | | $record[$key] = number_format($record[$key], $conf['number_format_decimals'], $conf['number_format_dec_point'], $conf['number_format_thousands_sep']); |
| | | break; |
| | | |
| | | default: |
| | |
| | | * @return record |
| | | */ |
| | | function decode($record,$tab) { |
| | | if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab)."); |
| | | global $conf; |
| | | if(!is_array($this->formDef['tabs'][$tab])) $app->error("Tab does not exist or the tab is empty (TAB: $tab)."); |
| | | $new_record = ''; |
| | | if(is_array($record)) { |
| | | foreach($this->formDef['tabs'][$tab]['fields'] as $key => $field) { |
| | |
| | | break; |
| | | |
| | | case 'CURRENCY': |
| | | $new_record[$key] = number_format((double)$record[$key], 2, ',', ''); |
| | | $new_record[$key] = number_format((double)$record[$key], $conf['number_format_decimals'], $conf['number_format_dec_point'], $conf['number_format_thousands_sep']); |
| | | break; |
| | | |
| | | default: |
| | |
| | | $conf['language'] = 'en'; |
| | | $conf['debug_language'] = false; |
| | | |
| | | //** Currency formatting |
| | | $conf['number_format_decimals'] = 2; |
| | | $conf['number_format_dec_point'] = ','; |
| | | $conf['number_format_thousands_sep'] = ''; |
| | | |
| | | |
| | | //** Misc. |
| | | $conf['interface_logout_url'] = ''; // example: http://www.domain.tld/ |