X

Create New Item

File Folder

X

Search Results

File "IntOrFloat.php"

Full path: /home/andyrdhboardrevi/public_html/learn.andyrdhboardreview.com/vendor/phpoffice/phpspreadsheet/src/PhpSpreadsheet/Shared/IntOrFloat.php
File size: 394 B
MIME-type: text/x-php
Charset: utf-8

Download   Open   Edit   Advanced Edit   Back

<?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;
    }
}