You are here

public static function PHPExcel_Calculation_TextData::VALUE in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php \PHPExcel_Calculation_TextData::VALUE()

* VALUE * *

Parameters

mixed $value Value to check: * @return boolean

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/TextData.php, line 595

Class

PHPExcel_Calculation_TextData
PHPExcel_Calculation_TextData

Code

public static function VALUE($value = '') {
  $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
  if (!is_numeric($value)) {
    $numberValue = str_replace(PHPExcel_Shared_String::getThousandsSeparator(), '', trim($value, " \t\n\r\0\v" . PHPExcel_Shared_String::getCurrencyCode()));
    if (is_numeric($numberValue)) {
      return (double) $numberValue;
    }
    $dateSetting = PHPExcel_Calculation_Functions::getReturnDateType();
    PHPExcel_Calculation_Functions::setReturnDateType(PHPExcel_Calculation_Functions::RETURNDATE_EXCEL);
    if (strpos($value, ':') !== false) {
      $timeValue = PHPExcel_Calculation_DateTime::TIMEVALUE($value);
      if ($timeValue !== PHPExcel_Calculation_Functions::VALUE()) {
        PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
        return $timeValue;
      }
    }
    $dateValue = PHPExcel_Calculation_DateTime::DATEVALUE($value);
    if ($dateValue !== PHPExcel_Calculation_Functions::VALUE()) {
      PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
      return $dateValue;
    }
    PHPExcel_Calculation_Functions::setReturnDateType($dateSetting);
    return PHPExcel_Calculation_Functions::VALUE();
  }
  return (double) $value;
}