Documentation

Percentage extends NumberBase
in package
implements Wizard

Table of Contents

Interfaces

Wizard

Constants

MAX_DECIMALS  = 30

Properties

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

Methods

__construct()  : mixed
__toString()  : string
format()  : string
setDecimals()  : void
setLocale()  : void
Setting a locale will override any settings defined in this class.
getLocaleFormat()  : string
Stub: should be implemented as a concrete method in concrete wizards.
validateLocale()  : string

Constants

Properties

$fullLocale

protected string|null $fullLocale = null

$localeFormat

protected string|null $localeFormat = null

Methods

__construct()

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

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

$locale : string|null = null

Set the locale for the percentage format; or leave as the default null. 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

getLocaleFormat()

Stub: should be implemented as a concrete method in concrete wizards.

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