Property | Type | Description | |
---|---|---|---|
$numbersReader |
Method | Description | |
---|---|---|
format ( mixed $value, |
Formats provided value using optional style properties | |
formatCurrencyNumber ( mixed $number, |
Formats number with format string for currency defined in CLDR for particular locale. | |
formatDecimalNumber ( mixed $number, |
Formats number with format string for decimal numbers defined in CLDR for particular locale. | |
formatNumberWithCustomPattern ( mixed $number, string $format, |
Returns number formatted by custom format, string provided in parameter. | |
formatPercentNumber ( mixed $number, |
Formats number with format string for percentage defined in CLDR for particular locale. | |
injectNumbersReader ( |
Method | Description | |
---|---|---|
doFormattingWithParsedFormat ( mixed $number, array $parsedFormat, array $symbols, string $currency = null ) : string | Formats provided float or integer. |
protected doFormattingWithParsedFormat ( mixed $number, array $parsedFormat, array $symbols, string $currency = null ) : string | ||
$number | mixed | Float or int, can be negative, can be NaN or infinite |
$parsedFormat | array | An array describing format (as in $parsedFormats property) |
$symbols | array | An array with symbols to use (as in $localeSymbols property) |
$currency | string | Currency symbol to be inserted into formatted number (if applicable) |
return | string | Formatted number. Will return string-casted version of $number if pattern is FALSE |
public format ( mixed $value, |
||
$value | mixed | Formatter-specific variable to format (can be integer, \DateTime, etc) |
$locale | Locale to use | |
$styleProperties | array | Integer-indexed array of formatter-specific style properties (can be empty) |
return | string | String representation of $value provided, or (string)$value |
public formatCurrencyNumber ( mixed $number, |
||
$number | mixed | Float or int, can be negative, can be NaN or infinite |
$locale | ||
$currency | string | Currency symbol (or name) |
$formatLength | string | One of NumbersReader FORMAT_LENGTH constants |
return | string | Formatted number. Will return string-casted version of $number if there is no pattern for given $locale / $formatLength |
public formatDecimalNumber ( mixed $number, |
||
$number | mixed | Float or int, can be negative, can be NaN or infinite |
$locale | ||
$formatLength | string | One of NumbersReader FORMAT_LENGTH constants |
return | string | Formatted number. Will return string-casted version of $number if there is no pattern for given $locale / $formatLength |
public formatNumberWithCustomPattern ( mixed $number, string $format, |
||
$number | mixed | Float or int, can be negative, can be NaN or infinite |
$format | string | Format string |
$locale | A locale used for finding symbols array | |
return | string | Formatted number. Will return string-casted version of $number if pattern is not valid / supported |
public formatPercentNumber ( mixed $number, |
||
$number | mixed | Float or int, can be negative, can be NaN or infinite |
$locale | ||
$formatLength | string | One of NumbersReader FORMAT_LENGTH constants |
return | string | Formatted number. Will return string-casted version of $number if there is no pattern for given $locale / $formatLength |
public injectNumbersReader ( |
||
$numbersReader | ||
return | void |