You are here

public static function PHPExcel_Calculation_MathTrig::INT in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php \PHPExcel_Calculation_MathTrig::INT()

* INT * * Casts a floating point value to an integer * * Excel Function: * INT(number) * * @access public * @category Mathematical and Trigonometric Functions *

Parameters

float $number Number to cast to an integer: * @return integer Integer value

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php, line 423

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function INT($number) {
  $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
  if (is_null($number)) {
    return 0;
  }
  elseif (is_bool($number)) {
    return (int) $number;
  }
  if (is_numeric($number)) {
    return (int) floor($number);
  }
  return PHPExcel_Calculation_Functions::VALUE();
}