Overview

Packages

  • JAMA
  • None
  • PHP
  • PHPExcel
    • CachedObjectStorage
    • Calculation
    • Cell
    • Chart
      • Renderer
    • Reader
      • Excel2007
      • Excel5
    • RichText
    • Settings
    • Shared
      • Escher
      • OLE
      • Trend
      • ZipArchive
    • Style
    • Worksheet
      • Drawing
    • Writer
      • 2007
      • CSV
      • Excel2007
      • Excel5
      • HTML
      • PDF

Classes

  • PHPExcel_Style
  • PHPExcel_Style_Alignment
  • PHPExcel_Style_Border
  • PHPExcel_Style_Borders
  • PHPExcel_Style_Color
  • PHPExcel_Style_Conditional
  • PHPExcel_Style_Fill
  • PHPExcel_Style_Font
  • PHPExcel_Style_NumberFormat
  • PHPExcel_Style_Protection
  • PHPExcel_Style_Supervisor
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Class PHPExcel_Style_NumberFormat

PHPExcel_Style_NumberFormat

PHPExcel_Style_Supervisor
Extended by PHPExcel_Style_NumberFormat implements PHPExcel_IComparable
Package: PHPExcel\Style
Category: PHPExcel
Copyright: Copyright (c) 2006 - 2014 PHPExcel (http://www.codeplex.com/PHPExcel)
License: LGPL
Located at controlador/include/phpexcel/PHPExcel/Style/NumberFormat.php
Methods summary
public
# __construct( boolean $isSupervisor = FALSE, boolean $isConditional = FALSE )

Create a new PHPExcel_Style_NumberFormat

Create a new PHPExcel_Style_NumberFormat

Parameters

$isSupervisor

Flag indicating if this is a supervisor or not Leave this value at default unless you understand exactly what its ramifications are

$isConditional

Flag indicating if this is a conditional style or not Leave this value at default unless you understand exactly what its ramifications are

Overrides

PHPExcel_Style_Supervisor::__construct()
public PHPExcel_Style_NumberFormat
# getSharedComponent( )

Get the shared style component for the currently active cell in currently active sheet. Only used for style supervisor

Get the shared style component for the currently active cell in currently active sheet. Only used for style supervisor

Returns

PHPExcel_Style_NumberFormat
public array
# getStyleArray( array $array )

Build style array from subcomponents

Build style array from subcomponents

Parameters

$array

Returns

array
public PHPExcel_Style_NumberFormat
# applyFromArray( array $pStyles = null )

Apply styles from array

Apply styles from array

$objPHPExcel->getActiveSheet()->getStyle('B2')->getNumberFormat()->applyFromArray(
    array(
        'code' => PHPExcel_Style_NumberFormat::FORMAT_CURRENCY_EUR_SIMPLE
    )
);

Parameters

$pStyles
Array containing style information

Returns

PHPExcel_Style_NumberFormat

Throws

PHPExcel_Exception
public string
# getFormatCode( )

Get Format Code

Get Format Code

Returns

string
public PHPExcel_Style_NumberFormat
# setFormatCode( string $pValue = PHPExcel_Style_NumberFormat::FORMAT_GENERAL )

Set Format Code

Set Format Code

Parameters

$pValue

Returns

PHPExcel_Style_NumberFormat
public integer
# getBuiltInFormatCode( )

Get Built-In Format Code

Get Built-In Format Code

Returns

integer
public PHPExcel_Style_NumberFormat
# setBuiltInFormatCode( integer $pValue = 0 )

Set Built-In Format Code

Set Built-In Format Code

Parameters

$pValue

Returns

PHPExcel_Style_NumberFormat
private static
# fillBuiltInFormatCodes( )

Fill built-in format codes

Fill built-in format codes

public static string
# builtInFormatCode( integer $pIndex )

Get built-in format code

Get built-in format code

Parameters

$pIndex

Returns

string
public static integer|boolean
# builtInFormatCodeIndex( string $formatCode )

Get built-in format code index

Get built-in format code index

Parameters

$formatCode

Returns

integer|boolean
public string
# getHashCode( )

Get hash code

Get hash code

Returns

string
Hash code

Implementation of

PHPExcel_IComparable::getHashCode()
private static
# _formatAsDate( & $value, & $format )
private static
# _formatAsPercentage( & $value, & $format )
private static
# _formatAsFraction( & $value, & $format )
private static
# _complexNumberFormatMask( $number, $mask )
public static string
# toFormattedString( mixed $value = '0', string $format = PHPExcel_Style_NumberFormat::FORMAT_GENERAL, array $callBack = null )

Convert a value in a pre-defined format to a PHP string

Convert a value in a pre-defined format to a PHP string

Parameters

$value
Value to format
$format
Format code
$callBack
Callback function for additional formatting of string

Returns

string
Formatted string
Methods inherited from PHPExcel_Style_Supervisor
__clone(), bindParent(), getActiveCell(), getActiveSheet(), getIsSupervisor(), getSelectedCells()
Constants summary
string FORMAT_GENERAL
# 'General'
string FORMAT_TEXT
# '@'
string FORMAT_NUMBER
# '0'
string FORMAT_NUMBER_00
# '0.00'
string FORMAT_NUMBER_COMMA_SEPARATED1
# '#,##0.00'
string FORMAT_NUMBER_COMMA_SEPARATED2
# '#,##0.00_-'
string FORMAT_PERCENTAGE
# '0%'
string FORMAT_PERCENTAGE_00
# '0.00%'
string FORMAT_DATE_YYYYMMDD2
# 'yyyy-mm-dd'
string FORMAT_DATE_YYYYMMDD
# 'yy-mm-dd'
string FORMAT_DATE_DDMMYYYY
# 'dd/mm/yy'
string FORMAT_DATE_DMYSLASH
# 'd/m/y'
string FORMAT_DATE_DMYMINUS
# 'd-m-y'
string FORMAT_DATE_DMMINUS
# 'd-m'
string FORMAT_DATE_MYMINUS
# 'm-y'
string FORMAT_DATE_XLSX14
# 'mm-dd-yy'
string FORMAT_DATE_XLSX15
# 'd-mmm-yy'
string FORMAT_DATE_XLSX16
# 'd-mmm'
string FORMAT_DATE_XLSX17
# 'mmm-yy'
string FORMAT_DATE_XLSX22
# 'm/d/yy h:mm'
string FORMAT_DATE_DATETIME
# 'd/m/y h:mm'
string FORMAT_DATE_TIME1
# 'h:mm AM/PM'
string FORMAT_DATE_TIME2
# 'h:mm:ss AM/PM'
string FORMAT_DATE_TIME3
# 'h:mm'
string FORMAT_DATE_TIME4
# 'h:mm:ss'
string FORMAT_DATE_TIME5
# 'mm:ss'
string FORMAT_DATE_TIME6
# 'h:mm:ss'
string FORMAT_DATE_TIME7
# 'i:s.S'
string FORMAT_DATE_TIME8
# 'h:mm:ss;@'
string FORMAT_DATE_YYYYMMDDSLASH
# 'yy/mm/dd;@'
string FORMAT_CURRENCY_USD_SIMPLE
# '"$"#,##0.00_-'
string FORMAT_CURRENCY_USD
# '$#,##0_-'
string FORMAT_CURRENCY_EUR_SIMPLE
# '[$EUR ]#,##0.00_-'
Properties summary
protected static array $_builtInFormats

Excel built-in number formats

Excel built-in number formats

#
protected static array $_flippedBuiltInFormats

Excel built-in number formats (flipped, for faster lookups)

Excel built-in number formats (flipped, for faster lookups)

#
protected string $_formatCode

Format Code

Format Code

# PHPExcel_Style_NumberFormat::FORMAT_GENERAL
protected string $_builtInFormatCode

Built-in format Code

Built-in format Code

# 0
private static array $_dateFormatReplacements

Search/replace values to convert Excel date/time format masks to PHP format masks

Search/replace values to convert Excel date/time format masks to PHP format masks

# array( // first remove escapes related to non-format characters '\\' => '', // 12-hour suffix 'am/pm' => 'A', // 4-digit year 'e' => 'Y', 'yyyy' => 'Y', // 2-digit year 'yy' => 'y', // first letter of month - no php equivalent 'mmmmm' => 'M', // full month name 'mmmm' => 'F', // short month name 'mmm' => 'M', // mm is minutes if time, but can also be month w/leading zero // so we try to identify times be the inclusion of a : separator in the mask // It isn't perfect, but the best way I know how ':mm' => ':i', 'mm:' => 'i:', // month leading zero 'mm' => 'm', // month no leading zero 'm' => 'n', // full day of week name 'dddd' => 'l', // short day of week name 'ddd' => 'D', // days leading zero 'dd' => 'd', // days no leading zero 'd' => 'j', // seconds 'ss' => 's', // fractional seconds - no php equivalent '.s' => '' )
private static array $_dateFormatReplacements24

Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock)

Search/replace values to convert Excel date/time format masks hours to PHP format masks (24 hr clock)

# array( 'hh' => 'H', 'h' => 'G' )
private static array $_dateFormatReplacements12

Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock)

Search/replace values to convert Excel date/time format masks hours to PHP format masks (12 hr clock)

# array( 'hh' => 'h', 'h' => 'g' )
Properties inherited from PHPExcel_Style_Supervisor
$_isSupervisor, $_parent
Autene API documentation generated by ApiGen