You are here

public static function PHPExcel_Calculation_MathTrig::QUOTIENT 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::QUOTIENT()

* QUOTIENT * * QUOTIENT function returns the integer portion of a division. Numerator is the divided number * and denominator is the divisor. * * Excel Function: * QUOTIENT(value1[,value2[, ...]]) * * @access public * @category Mathematical and Trigonometric Functions *

Parameters

mixed $arg,... Data values: * @return float

File

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

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function QUOTIENT() {

  // Return value
  $returnValue = null;

  // Loop through arguments
  foreach (PHPExcel_Calculation_Functions::flattenArray(func_get_args()) as $arg) {

    // Is it a numeric value?
    if (is_numeric($arg) && !is_string($arg)) {
      if (is_null($returnValue)) {
        $returnValue = $arg == 0 ? 0 : $arg;
      }
      else {
        if ($returnValue == 0 || $arg == 0) {
          $returnValue = 0;
        }
        else {
          $returnValue /= $arg;
        }
      }
    }
  }

  // Return
  return intval($returnValue);
}