You are here

public static function PHPExcel_Calculation_MathTrig::EVEN in Loft Data Grids 7.2

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

* EVEN * * Returns number rounded up to the nearest even integer. * You can use this function for processing items that come in twos. For example, * a packing crate accepts rows of one or two items. The crate is full when * the number of items, rounded up to the nearest two, matches the crate's * capacity. * * Excel Function: * EVEN(number) * * @access public * @category Mathematical and Trigonometric Functions *

Parameters

float $number Number to round: * @return int Rounded Number

1 call to PHPExcel_Calculation_MathTrig::EVEN()
PHPExcel_Calculation_MathTrig::ODD in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* ODD * * Returns number rounded up to the nearest odd integer. * *

File

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

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function EVEN($number) {
  $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
  if (is_null($number)) {
    return 0;
  }
  elseif (is_bool($number)) {
    $number = (int) $number;
  }
  if (is_numeric($number)) {
    $significance = 2 * self::SIGN($number);
    return (int) self::CEILING($number, $significance);
  }
  return PHPExcel_Calculation_Functions::VALUE();
}