Bug in FIXED Function

Fix #4889. Function was not outputting correct number of decimals when thousands separator was omitted.
This commit is contained in:
oleibman
2026-05-31 09:26:18 -07:00
parent 7cc6e4e580
commit 38f346661b
2 changed files with 9 additions and 0 deletions
@@ -103,6 +103,13 @@ class Format
StringHelper::getDecimalSeparator(),
StringHelper::getThousandsSeparator()
);
} else {
$valueResult = number_format(
$valueResult,
$decimals,
StringHelper::getDecimalSeparator(),
''
);
}
return (string) $valueResult;
@@ -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],
];