You are here

public static function PHPExcel_Calculation_TextData::TEXTFORMAT in Loft Data Grids 6.2

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

* TEXTFORMAT * *

Parameters

mixed $value Value to check: * @param string $format Format mask to use * @return boolean

File

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

Class

PHPExcel_Calculation_TextData
PHPExcel_Calculation_TextData

Code

public static function TEXTFORMAT($value, $format) {
  $value = PHPExcel_Calculation_Functions::flattenSingleValue($value);
  $format = PHPExcel_Calculation_Functions::flattenSingleValue($format);
  if (is_string($value) && !is_numeric($value) && PHPExcel_Shared_Date::isDateTimeFormatCode($format)) {
    $value = PHPExcel_Calculation_DateTime::DATEVALUE($value);
  }
  return (string) PHPExcel_Style_NumberFormat::toFormattedString($value, $format);
}