mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-08-24 22:58:09 +00:00
4f6d1f77a3
PR #3513, developed by @SaidkhojaIftikhor, has been stuck for some time awaiting tests. This is the first of three PRs to replace that one. This accomodates the use of slash as a delimiter in functions TEXTAFTER, TEXTBEFORE, TEXTSPLIT, and NUMBERVALUE. The source changes are very simple. Additional tests exercise all the source changes.
61 lines
1.3 KiB
PHP
61 lines
1.3 KiB
PHP
<?php
|
|
|
|
return [
|
|
[
|
|
1234567.89,
|
|
'1,234,567.890',
|
|
],
|
|
[
|
|
1234567.89,
|
|
'1 234 567,890', ',', ' ',
|
|
],
|
|
[
|
|
-1234567.89,
|
|
'-1 234 567,890', ',', ' ',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1 234 567,890-', ',', ' ',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1,234,567.890,123',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1.234.567.890,123',
|
|
],
|
|
[
|
|
1234567.890,
|
|
'1.234.567,890', ',', '.',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1.234.567,89',
|
|
],
|
|
[
|
|
12345.6789,
|
|
'1,234,567.89%',
|
|
],
|
|
[
|
|
123.456789,
|
|
'1,234,567.89%%',
|
|
],
|
|
[
|
|
1.23456789,
|
|
'1,234,567.89%%%',
|
|
],
|
|
[
|
|
'#VALUE!',
|
|
'1,234,567.89-%',
|
|
],
|
|
'no arguments' => ['exception'],
|
|
'boolean argument' => ['#VALUE!', true],
|
|
'slash as group separator' => [1234567.1, '1/234/567.1', '.', '/'],
|
|
'slash as decimal separator' => [1234567.1, '1,234,567/1', '/', ','],
|
|
'issue 3574 null string treated as 0' => [0, '', ',', ' '],
|
|
'issue 3574 one or more spaces treated as 0' => [0, ' ', ',', ' '],
|
|
'issue 3574 non-blank numeric string okay' => [2, ' 2 ', ',', ' '],
|
|
'issue 3574 non-blank non-numeric string invalid' => ['#VALUE!', ' x ', ',', ' '],
|
|
];
|