From 663da8929365b02bac8ec982471d0e087b694c7e Mon Sep 17 00:00:00 2001 From: jekkos Date: Thu, 22 Apr 2021 17:18:22 +0200 Subject: [PATCH] Fix decimal render (#2975) --- application/helpers/locale_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/helpers/locale_helper.php b/application/helpers/locale_helper.php index 44f327027..279d2045d 100644 --- a/application/helpers/locale_helper.php +++ b/application/helpers/locale_helper.php @@ -399,7 +399,7 @@ function to_decimals($number, $decimals=NULL, $type=\NumberFormatter::DECIMAL) $config = get_instance()->config; $fmt = new \NumberFormatter($config->item('number_locale'), $type); - $fmt->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, 0); + $fmt->setAttribute(\NumberFormatter::MIN_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : $config->item($decimals)); $fmt->setAttribute(\NumberFormatter::MAX_FRACTION_DIGITS, empty($decimals) ? DEFAULT_PRECISION : $config->item($decimals)); if(empty($config->item('thousands_separator')))