Fix decimal render (#2975)

This commit is contained in:
jekkos
2021-04-22 17:18:22 +02:00
parent 8513a2b85b
commit 663da89293

View File

@@ -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')))