Merge pull request #4891 from oleibman/issue4889

Bug in FIXED Function
This commit is contained in:
oleibman
2026-06-01 15:34:04 +00:00
committed by GitHub
2 changed files with 8 additions and 9 deletions
@@ -96,16 +96,13 @@ class Format
if ($decimals < 0) {
$decimals = 0;
}
if ($noCommas === false) {
$valueResult = number_format(
$valueResult,
$decimals,
StringHelper::getDecimalSeparator(),
StringHelper::getThousandsSeparator()
);
}
return (string) $valueResult;
return number_format(
$valueResult,
$decimals,
StringHelper::getDecimalSeparator(),
$noCommas ? '' : StringHelper::getThousandsSeparator()
);
}
/**
@@ -66,4 +66,6 @@ return [
'null second argument' => ['123', 123, null],
'false second argument' => ['123', 123, false],
'true second argument' => ['123.0', 123, true],
'fixed decimals without thousands separator' => ['1507.50', 1507.5, 2, true],
'fixed decimals with thousands separator' => ['1,507.50', 1507.5, 2, false],
];