Adding float cast to MOD function
If $a or $b are not strings, you can get an error that fmod needs param 1 ($a) to be of type double. MS Excel does not fall over when you insert an empty string in MOD, so I'm guessing PHPExcel should do the same?
This commit is contained in:
parent
48a6e86adc
commit
39b8dbd0a1
|
@ -673,8 +673,8 @@ class MathTrig
|
||||||
*/
|
*/
|
||||||
public static function MOD($a = 1, $b = 1)
|
public static function MOD($a = 1, $b = 1)
|
||||||
{
|
{
|
||||||
$a = Functions::flattenSingleValue($a);
|
$a = (float) Functions::flattenSingleValue($a);
|
||||||
$b = Functions::flattenSingleValue($b);
|
$b = (float) Functions::flattenSingleValue($b);
|
||||||
|
|
||||||
if ($b == 0.0) {
|
if ($b == 0.0) {
|
||||||
return Functions::DIV0();
|
return Functions::DIV0();
|
||||||
|
|
|
@ -46,4 +46,9 @@ return [
|
||||||
1.3,
|
1.3,
|
||||||
1.2,
|
1.2,
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
'',
|
||||||
|
1,
|
||||||
|
0,
|
||||||
|
],
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue