PATH:
home
/
lab2454c
/
aficb.com
/
vendor
/
phpoffice
/
phpspreadsheet
/
src
/
PhpSpreadsheet
/
Calculation
/
MathTrig
<?php namespace PhpOffice\PhpSpreadsheet\Calculation\MathTrig; use PhpOffice\PhpSpreadsheet\Calculation\ArrayEnabled; use PhpOffice\PhpSpreadsheet\Calculation\Exception; class Trunc { use ArrayEnabled; /** * TRUNC. * * Truncates value to the number of fractional digits by number_digits. * * @param array|float $value * Or can be an array of values * @param array|int $digits * Or can be an array of values * * @return array|float|string Truncated value, or a string containing an error * If an array of numbers is passed as an argument, then the returned result will also be an array * with the same dimensions */ public static function evaluate($value = 0, $digits = 0) { if (is_array($value) || is_array($digits)) { return self::evaluateArrayArguments([self::class, __FUNCTION__], $value, $digits); } try { $value = Helpers::validateNumericNullBool($value); $digits = Helpers::validateNumericNullSubstitution($digits, null); } catch (Exception $e) { return $e->getMessage(); } $digits = floor($digits); // Truncate $adjust = 10 ** $digits; if (($digits > 0) && (rtrim((string) (int) ((abs($value) - abs((int) $value)) * $adjust), '0') < $adjust / 10)) { return $value; } return ((int) ($value * $adjust)) / $adjust; } }
[-] Roman.php
[edit]
[-] MatrixFunctions.php
[edit]
[-] Absolute.php
[edit]
[-] Floor.php
[edit]
[-] Angle.php
[edit]
[+]
..
[-] Combinations.php
[edit]
[-] Gcd.php
[edit]
[-] Round.php
[edit]
[-] IntClass.php
[edit]
[-] SeriesSum.php
[edit]
[-] Sign.php
[edit]
[-] Factorial.php
[edit]
[-] Subtotal.php
[edit]
[-] Arabic.php
[edit]
[-] Sum.php
[edit]
[-] Exp.php
[edit]
[-] Logarithms.php
[edit]
[-] Lcm.php
[edit]
[-] Operations.php
[edit]
[-] Helpers.php
[edit]
[-] Base.php
[edit]
[-] Sqrt.php
[edit]
[-] Trunc.php
[edit]
[+]
Trig
[-] Ceiling.php
[edit]
[-] Random.php
[edit]
[-] SumSquares.php
[edit]