PHPExcel_Style_NumberFormat

category | PHPExcel
package | PHPExcel_Style
copyright | Copyright (c) 2006 - 2013 PHPExcel (http://www.codeplex.com/PHPExcel)

### Methods

## Implement PHP __clone to create a deep clone, not just a shallow copy.

    __clone()

Inherited

inherited_from | \PHPExcel_Style_Supervisor::__clone()

## Create a new PHPExcel_Style_NumberFormat

    __construct(boolean $isSupervisor, boolean $isConditional)

### Parameters

#### $isSupervisor

`boolean`

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

#### $isConditional

`boolean`

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

## Apply styles from array

    applyFromArray(array $pStyles) : \PHPExcel_Style_NumberFormat

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

### Parameters

#### $pStyles

`array`

Array containing style information

### Exceptions

`\PHPExcel_Exception` |

### Returns

`\PHPExcel_Style_NumberFormat`

## Bind parent.

    bindParent(\PHPExcel $parent, $parentPropertyName) : \PHPExcel_Style_Supervisor

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::bindParent()

### Parameters

#### $parent

`\PHPExcel`

#### $parentPropertyName

### Returns

`\PHPExcel_Style_Supervisor`

## Get built-in format code

    builtInFormatCode(int $pIndex) : string

Static

### Parameters

#### $pIndex

`int`

### Returns

`string`

## Get built-in format code index

    builtInFormatCodeIndex(string $formatCode) : int | boolean

Static

### Parameters

#### $formatCode

`string`

### Returns

`int` `boolean`

## Get the currently active cell coordinate in currently active sheet.

    getActiveCell() : string

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getActiveCell()

### Returns

`string`E.g. 'A1'

## Get the currently active sheet.

    getActiveSheet() : \PHPExcel_Worksheet

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getActiveSheet()

### Returns

`\PHPExcel_Worksheet`

## Get Built-In Format Code

    getBuiltInFormatCode() : int

### Returns

`int`

## Get Format Code

    getFormatCode() : string

### Returns

`string`

## Get hash code

    getHashCode() : string

### Returns

`string`Hash code

## Is this a supervisor or a cell style component?

    getIsSupervisor() : boolean

Inherited

inherited_from | \PHPExcel_Style_Supervisor::getIsSupervisor()

### Returns

`boolean`

## Get the currently active cell coordinate in currently active sheet.

    getSelectedCells() : string

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::getSelectedCells()

### Returns

`string`E.g. 'A1'

## Get the shared style component for the currently active cell in currently active sheet.

    getSharedComponent() : \PHPExcel_Style_NumberFormat

Only used for style supervisor

### Returns

`\PHPExcel_Style_NumberFormat`

## Build style array from subcomponents

    getStyleArray(array $array) : array

### Parameters

#### $array

`array`

### Returns

`array`

## Set Built-In Format Code

    setBuiltInFormatCode(int $pValue) : \PHPExcel_Style_NumberFormat

### Parameters

#### $pValue

`int`

### Returns

`\PHPExcel_Style_NumberFormat`

## Set Format Code

    setFormatCode(string $pValue) : \PHPExcel_Style_NumberFormat

### Parameters

#### $pValue

`string`

### Returns

`\PHPExcel_Style_NumberFormat`

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

    toFormattedString(mixed $value, string $format, array $callBack) : string

Static

### Parameters

#### $value

`mixed`

Value to format

#### $format

`string`

Format code

#### $callBack

`array`

Callback function for additional formatting of string

### Returns

`string`Formatted string

## _complexNumberFormatMask()

    _complexNumberFormatMask($number, $mask)

Static

### Parameters

#### $number

#### $mask

## _formatAsDate()

    _formatAsDate($value, $format)

Static

### Parameters

#### $value

#### $format

## _formatAsFraction()

    _formatAsFraction($value, $format)

Static

### Parameters

#### $value

#### $format

## _formatAsPercentage()

    _formatAsPercentage($value, $format)

Static

### Parameters

#### $value

#### $format

## Fill built-in format codes

    fillBuiltInFormatCodes()

Static

### Properties

##

    $_builtInFormatCode : string

##

    $_builtInFormats : array

##

    $_flippedBuiltInFormats : array

##

    $_formatCode : string

##

    $_isSupervisor : boolean

Inherited

inherited_from | \PHPExcel_Style_Supervisor::$$_isSupervisor

##

    $_parent : \PHPExcel_Style

Inherited

Only used for supervisor

inherited_from | \PHPExcel_Style_Supervisor::$$_parent

##

    $_dateFormatReplacements : array

##

    $_dateFormatReplacements12 : array

##

    $_dateFormatReplacements24 : array

### Constants

## FORMAT_CURRENCY_EUR_SIMPLE

    FORMAT_CURRENCY_EUR_SIMPLE

## FORMAT_CURRENCY_USD

    FORMAT_CURRENCY_USD

## FORMAT_CURRENCY_USD_SIMPLE

    FORMAT_CURRENCY_USD_SIMPLE

## FORMAT_DATE_DATETIME

    FORMAT_DATE_DATETIME

## FORMAT_DATE_DDMMYYYY

    FORMAT_DATE_DDMMYYYY

## FORMAT_DATE_DMMINUS

    FORMAT_DATE_DMMINUS

## FORMAT_DATE_DMYMINUS

    FORMAT_DATE_DMYMINUS

## FORMAT_DATE_DMYSLASH

    FORMAT_DATE_DMYSLASH

## FORMAT_DATE_MYMINUS

    FORMAT_DATE_MYMINUS

## FORMAT_DATE_TIME1

    FORMAT_DATE_TIME1

## FORMAT_DATE_TIME2

    FORMAT_DATE_TIME2

## FORMAT_DATE_TIME3

    FORMAT_DATE_TIME3

## FORMAT_DATE_TIME4

    FORMAT_DATE_TIME4

## FORMAT_DATE_TIME5

    FORMAT_DATE_TIME5

## FORMAT_DATE_TIME6

    FORMAT_DATE_TIME6

## FORMAT_DATE_TIME7

    FORMAT_DATE_TIME7

## FORMAT_DATE_TIME8

    FORMAT_DATE_TIME8

## FORMAT_DATE_XLSX14

    FORMAT_DATE_XLSX14

## FORMAT_DATE_XLSX15

    FORMAT_DATE_XLSX15

## FORMAT_DATE_XLSX16

    FORMAT_DATE_XLSX16

## FORMAT_DATE_XLSX17

    FORMAT_DATE_XLSX17

## FORMAT_DATE_XLSX22

    FORMAT_DATE_XLSX22

## FORMAT_DATE_YYYYMMDD

    FORMAT_DATE_YYYYMMDD

## FORMAT_DATE_YYYYMMDD2

    FORMAT_DATE_YYYYMMDD2

## FORMAT_DATE_YYYYMMDDSLASH

    FORMAT_DATE_YYYYMMDDSLASH

## FORMAT_GENERAL

    FORMAT_GENERAL

## FORMAT_NUMBER

    FORMAT_NUMBER

## FORMAT_NUMBER_00

    FORMAT_NUMBER_00

## FORMAT_NUMBER_COMMA_SEPARATED1

    FORMAT_NUMBER_COMMA_SEPARATED1

## FORMAT_NUMBER_COMMA_SEPARATED2

    FORMAT_NUMBER_COMMA_SEPARATED2

## FORMAT_PERCENTAGE

    FORMAT_PERCENTAGE

## FORMAT_PERCENTAGE_00

    FORMAT_PERCENTAGE_00

## FORMAT_TEXT

    FORMAT_TEXT