mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-23 05:11:49 +00:00
38f346661b
Fix #4889. Function was not outputting correct number of decimals when thousands separator was omitted.
72 lines
1.2 KiB
PHP
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],
|
|
];
|