Commit 22147612 authored by tbrehm's avatar tbrehm

Added global currency format settings in $conf array.

parent 0c75bc2c
......@@ -148,6 +148,11 @@ $conf['logo'] = 'themes/default/images/ispc_logo.png';
$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/
......
......@@ -329,7 +329,7 @@ class listform {
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:
......
......@@ -163,7 +163,8 @@ class tform {
* @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) {
......@@ -198,7 +199,7 @@ class tform {
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:
......
......@@ -133,6 +133,11 @@ $conf['logo'] = 'themes/default/images/ispc_logo.png';
$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/
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment