mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-10-08 04:46:26 +00:00
TextData Coverage and Minor Bug Fixes (#1744)
This had been intended to get 100% coverage for TextData functions, and it does that. However, some minor bugs requiring source changes arose during testing. - the Excel CHAR function restricts its argument to 1-255. PhpSpreadsheet CHARACTER had been allowing 0+. Also, there is no need to test if iconv exists, since it is part of Composer requirements. - The DOLLAR function had been returning NUM for invalid arguments. Excel returns VALUE. Also, negative amounts were not being handled correctly. - The FIXEDFORMAT function had been returning NUM for invalid arguments. Excel FIXED returns VALUE.
This commit is contained in:
@@ -6,11 +6,20 @@ return [
|
||||
123.456,
|
||||
2,
|
||||
],
|
||||
[
|
||||
'$123.46',
|
||||
123.456,
|
||||
],
|
||||
[
|
||||
'$123.32',
|
||||
123.321,
|
||||
2,
|
||||
],
|
||||
[
|
||||
'($123.32)',
|
||||
-123.321,
|
||||
2,
|
||||
],
|
||||
[
|
||||
'$1,235,000',
|
||||
1234567,
|
||||
@@ -22,12 +31,17 @@ return [
|
||||
-5,
|
||||
],
|
||||
[
|
||||
'#NUM!',
|
||||
'($1,200,000)',
|
||||
-1234567,
|
||||
-5,
|
||||
],
|
||||
[
|
||||
'#VALUE!',
|
||||
'ABC',
|
||||
2,
|
||||
],
|
||||
[
|
||||
'#NUM!',
|
||||
'#VALUE!',
|
||||
123.456,
|
||||
'ABC',
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user