Documentation

Number extends NumberBase
in package
implements Wizard

Table of Contents

Interfaces

Wizard

Constants

WITH_THOUSANDS_SEPARATOR  = true
WITHOUT_THOUSANDS_SEPARATOR  = false
MAX_DECIMALS  = 30

Properties

$decimals  : int
$fullLocale  : string|null
$locale  : string|null
$localeFormat  : string|null
$thousandsSeparator  : bool

Methods

__construct()  : mixed
__toString()  : string
format()  : string
setDecimals()  : void
setLocale()  : void
Setting a locale will override any settings defined in this class.
setThousandsSeparator()  : void
getLocaleFormat()  : string
As MS Excel cannot easily handle Lakh, which is the only locale-specific Number format variant, we don't use locale with Numbers.
validateLocale()  : string

Constants

WITH_THOUSANDS_SEPARATOR

public mixed WITH_THOUSANDS_SEPARATOR = true

WITHOUT_THOUSANDS_SEPARATOR

public mixed WITHOUT_THOUSANDS_SEPARATOR = false

Properties

$fullLocale

protected string|null $fullLocale = null

$localeFormat

protected string|null $localeFormat = null

$thousandsSeparator

protected bool $thousandsSeparator = true

Methods

__construct()

public __construct([int $decimals = 2 ][, bool $thousandsSeparator = self::WITH_THOUSANDS_SEPARATOR ][, string|null $locale = null ]) : mixed
Parameters
$decimals : int = 2

number of decimal places to display, in the range 0-30

$thousandsSeparator : bool = self::WITH_THOUSANDS_SEPARATOR

indicator whether the thousands separator should be used, or not

$locale : string|null = null

Set the locale for the number format; or leave as the default null. Locale has no effect for Number Format values, and is retained here only for compatibility with the other Wizards. If provided, Locale values must be a valid formatted locale string (e.g. 'en-GB', 'fr', uz-Arab-AF).

Tags
throws
Exception

If a provided locale code is not a valid format

__toString()

public __toString() : string
Return values
string

format()

public format() : string
Return values
string

setDecimals()

public setDecimals([int $decimals = 2 ]) : void
Parameters
$decimals : int = 2

setLocale()

Setting a locale will override any settings defined in this class.

public setLocale([string|null $locale = null ]) : void
Parameters
$locale : string|null = null
Tags
throws
Exception

If the locale code is not a valid format

setThousandsSeparator()

public setThousandsSeparator([bool $thousandsSeparator = self::WITH_THOUSANDS_SEPARATOR ]) : void
Parameters
$thousandsSeparator : bool = self::WITH_THOUSANDS_SEPARATOR

getLocaleFormat()

As MS Excel cannot easily handle Lakh, which is the only locale-specific Number format variant, we don't use locale with Numbers.

protected getLocaleFormat() : string
Return values
string

validateLocale()

private validateLocale(string $locale) : string
Parameters
$locale : string
Tags
throws
Exception

If the locale code is not a valid format

Return values
string

        
On this page

Search results