Number
extends NumberBase
in package
implements
Wizard
Table of Contents
Interfaces
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
MAX_DECIMALS
protected
mixed
MAX_DECIMALS
= 30
Properties
$decimals
protected
int
$decimals
= 2
$fullLocale
protected
string|null
$fullLocale
= null
$locale
protected
string|null
$locale
= 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
__toString()
public
__toString() : string
Return values
stringformat()
public
format() : string
Return values
stringsetDecimals()
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
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
stringvalidateLocale()
private
validateLocale(string $locale) : string
Parameters
- $locale : string