PluginProbe
TablePress – Tables in WordPress made easy / 3.4
TablePress – Tables in WordPress made easy v3.4
3.4 3.3.4 3.3.3 3.3.2 3.3.1 trunk 1.12 1.14 1.9.2 2.0.4 2.1.7 2.1.8 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.3 2.3.1 2.3.2 2.4 2.4.1 2.4.2 2.4.3 All 45 releases
tablepress / libraries / vendor / PhpSpreadsheet / Calculation / MathTrig / IntClass.php

IntClass.php in TablePress – Tables in WordPress made easy 3.4, at libraries/vendor/PhpSpreadsheet/Calculation/MathTrig/IntClass.php

41 lines 1018 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace TablePress\PhpOffice\PhpSpreadsheet\Calculation\MathTrig;
4
5 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled;
6 use TablePress\PhpOffice\PhpSpreadsheet\Calculation\Exception;
7
8 class IntClass
9 {
10 use ArrayEnabled;
11
12 /**
13 * INT.
14 *
15 * Casts a floating point value to an integer
16 *
17 * Excel Function:
18 * INT(number)
19 *
20 * @param array<mixed>|float $number Number to cast to an integer, or can be an array of numbers
21 *
22 * @return array<mixed>|int|string Integer value, or a string containing an error
23 * If an array of numbers is passed as the argument, then the returned result will also be an array
24 * with the same dimensions
25 */
26 public static function evaluate($number)
27 {
28 if (is_array($number)) {
29 return self::evaluateSingleArgumentArray([self::class, __FUNCTION__], $number);
30 }
31
32 try {
33 $number = Helpers::validateNumericNullBool($number);
34 } catch (Exception $e) {
35 return $e->getMessage();
36 }
37
38 return (int) floor($number);
39 }
40 }
41