init
This commit is contained in:
commit
72a26edcff
22092 changed files with 2101903 additions and 0 deletions
17
lib/PhpSpreadsheet/Shared/IntOrFloat.php
Normal file
17
lib/PhpSpreadsheet/Shared/IntOrFloat.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
namespace PhpOffice\PhpSpreadsheet\Shared;
|
||||
|
||||
class IntOrFloat
|
||||
{
|
||||
/**
|
||||
* Help some functions with large results operate correctly on 32-bit,
|
||||
* by returning result as int when possible, float otherwise.
|
||||
*/
|
||||
public static function evaluate(float|int $value): float|int
|
||||
{
|
||||
$iValue = (int) $value;
|
||||
|
||||
return ($value == $iValue) ? $iValue : $value;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue