Files
PhpSpreadsheet/tests/data/Calculation/TextData/FIXED.php
T
oleibman 38f346661b Bug in FIXED Function
Fix #4889. Function was not outputting correct number of decimals when thousands separator was omitted.
2026-05-31 09:26:18 -07:00

72 lines
1.2 KiB
PHP

<?php
declare(strict_types=1);
return [
[
'123,456.79',
123456.789,
2,
false,
],
[
'123456.8',
123456.789,
1,
true,
],
[
'123456.79',
123456.789,
2,
true,
],
[
'-123456.79',
-123456.789,
2,
true,
],
[
'123500',
123456.789,
-2,
true,
],
[
'123,500',
123456.789,
-2,
],
[
'-123500',
-123456.789,
-2,
true,
],
[
'-123,500',
-123456.789,
-2,
],
[
'#VALUE!',
'ABC',
2,
null,
],
[
'#VALUE!',
123.456,
'ABC',
null,
],
'no arguments' => ['exception'],
'just one argument is okay' => ['123.00', 123],
'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],
];