You are here

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

* SIGN * * Determines the sign of a number. Returns 1 if the number is positive, zero (0) * if the number is 0, and -1 if the number is negative. * *

Parameters

float $number Number to round: * @return int sign value

5 calls to PHPExcel_Calculation_MathTrig::SIGN()
PHPExcel_Calculation_MathTrig::CEILING in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* CEILING * * Returns number rounded up, away from zero, to the nearest multiple of significance. * For example, if you want to avoid using pennies in your prices and your product is * priced at $4.42, use the formula =CEILING(4.42,0.05) to…
PHPExcel_Calculation_MathTrig::EVEN in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* 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…
PHPExcel_Calculation_MathTrig::FLOOR in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* FLOOR * * Rounds number down, toward zero, to the nearest multiple of significance. * * Excel Function: * FLOOR(number[,significance]) * * @access public * @category Mathematical and Trigonometric Functions *
PHPExcel_Calculation_MathTrig::MROUND in vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/MathTrig.php
* MROUND * * Rounds a number to the nearest multiple of a specified value * *
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 1021

Class

PHPExcel_Calculation_MathTrig
PHPExcel_Calculation_MathTrig

Code

public static function SIGN($number) {
  $number = PHPExcel_Calculation_Functions::flattenSingleValue($number);
  if (is_bool($number)) {
    return (int) $number;
  }
  if (is_numeric($number)) {
    if ($number == 0.0) {
      return 0;
    }
    return $number / abs($number);
  }
  return PHPExcel_Calculation_Functions::VALUE();
}