mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-19 01:50:34 +00:00
Bug in FIXED Function
Fix #4889. Function was not outputting correct number of decimals when thousands separator was omitted.
This commit is contained in:
@@ -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],
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user