From 12c825ba84e4402b0ae329064db182423ed2cadc Mon Sep 17 00:00:00 2001 From: atm-greg Date: Fri, 18 Feb 2022 10:50:00 +0100 Subject: [PATCH 1/2] fix rounding for price and display currency --- htdocs/core/class/extrafields.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index f8e5726d344..c0dc9c6a96f 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1679,7 +1679,8 @@ class ExtraFields } elseif ($type == 'price') { //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') { - $value = price($value, 0, $langs, 0, 0, -1); + $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency); + } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : ''); From b5afa2777422e3ee8b207b79f9592925f9d89ce4 Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Fri, 18 Feb 2022 10:09:38 +0000 Subject: [PATCH 2/2] Fixing style errors. --- htdocs/core/class/extrafields.class.php | 1 - 1 file changed, 1 deletion(-) diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php index c0dc9c6a96f..7a449f3e7ea 100644 --- a/htdocs/core/class/extrafields.class.php +++ b/htdocs/core/class/extrafields.class.php @@ -1680,7 +1680,6 @@ class ExtraFields //$value = price($value, 0, $langs, 0, 0, -1, $conf->currency); if ($value || $value == '0') { $value = price($value, 0, $langs, 0, $conf->global->MAIN_MAX_DECIMALS_TOT, -1).' '.$langs->getCurrencySymbol($conf->currency); - } } elseif ($type == 'select') { $valstr = (!empty($param['options'][$value]) ? $param['options'][$value] : '');