PHP Класс CommerceGuys\Intl\Formatter\NumberFormatter

Наследование: implements CommerceGuys\Intl\Formatter\NumberFormatterInterface
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$currencyDisplay integer The currency display style.
$digits array Localized digits.
$groupingUsed boolean Whether grouping is used.
$maximumFractionDigits integer The maximum number of fraction digits to show.
$minimumFractionDigits integer The minimum number of fraction digits to show.
$negativePattern string The number pattern used to format negative numbers.
$numberFormat CommerceGuys\Intl\NumberFormat\NumberFormatInterface The number format.
$positivePattern string The number pattern used to format positive numbers.
$primaryGroupSize integer The size of the group of digits closest to the decimal point.
$secondaryGroupSize integer The size of every group of digits after the primary group.

Открытые методы

Метод Описание
__construct ( CommerceGuys\Intl\NumberFormat\NumberFormatInterface $numberFormat, integer $style = self::DECIMAL ) Creaes a NumberFormatter instance.
format ( $value )
formatCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency )
getCurrencyDisplay ( )
getMaximumFractionDigits ( )
getMinimumFractionDigits ( )
getNumberFormat ( )
isGroupingUsed ( )
parseCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency )
setCurrencyDisplay ( $currencyDisplay )
setGroupingUsed ( $groupingUsed )
setMaximumFractionDigits ( $maximumFractionDigits )
setMinimumFractionDigits ( $minimumFractionDigits )

Защищенные методы

Метод Описание
replaceDigits ( string $value ) : string Replaces digits with their localized equivalents.
replaceSymbols ( string $value ) : string Replaces number symbols with their localized equivalents.

Описание методов

__construct() публичный Метод

Creaes a NumberFormatter instance.
public __construct ( CommerceGuys\Intl\NumberFormat\NumberFormatInterface $numberFormat, integer $style = self::DECIMAL )
$numberFormat CommerceGuys\Intl\NumberFormat\NumberFormatInterface The number format.
$style integer The formatting style.

format() публичный Метод

public format ( $value )

formatCurrency() публичный Метод

public formatCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency )
$currency CommerceGuys\Intl\Currency\CurrencyInterface

getCurrencyDisplay() публичный Метод

public getCurrencyDisplay ( )

getMaximumFractionDigits() публичный Метод

getMinimumFractionDigits() публичный Метод

getNumberFormat() публичный Метод

public getNumberFormat ( )

isGroupingUsed() публичный Метод

public isGroupingUsed ( )

parseCurrency() публичный Метод

public parseCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency )
$currency CommerceGuys\Intl\Currency\CurrencyInterface

replaceDigits() защищенный Метод

Replaces digits with their localized equivalents.
protected replaceDigits ( string $value ) : string
$value string The value being formatted.
Результат string

replaceSymbols() защищенный Метод

Replaces number symbols with their localized equivalents.
См. также: http://cldr.unicode.org/translation/number-symbols
protected replaceSymbols ( string $value ) : string
$value string The value being formatted.
Результат string

setCurrencyDisplay() публичный Метод

public setCurrencyDisplay ( $currencyDisplay )

setGroupingUsed() публичный Метод

public setGroupingUsed ( $groupingUsed )

setMaximumFractionDigits() публичный Метод

public setMaximumFractionDigits ( $maximumFractionDigits )

setMinimumFractionDigits() публичный Метод

public setMinimumFractionDigits ( $minimumFractionDigits )

Описание свойств

$currencyDisplay защищенное свойство

The currency display style.
protected int $currencyDisplay
Результат integer

$digits защищенное свойство

Localized digits.
protected array $digits
Результат array

$groupingUsed защищенное свойство

Whether grouping is used.
protected bool $groupingUsed
Результат boolean

$maximumFractionDigits защищенное свойство

The maximum number of fraction digits to show.
protected int $maximumFractionDigits
Результат integer

$minimumFractionDigits защищенное свойство

The minimum number of fraction digits to show.
protected int $minimumFractionDigits
Результат integer

$negativePattern защищенное свойство

The number pattern used to format negative numbers.
protected string $negativePattern
Результат string

$numberFormat защищенное свойство

The number format.
protected NumberFormatInterface,CommerceGuys\Intl\NumberFormat $numberFormat
Результат CommerceGuys\Intl\NumberFormat\NumberFormatInterface

$positivePattern защищенное свойство

The number pattern used to format positive numbers.
protected string $positivePattern
Результат string

$primaryGroupSize защищенное свойство

The size of the group of digits closest to the decimal point.
protected int $primaryGroupSize
Результат integer

$secondaryGroupSize защищенное свойство

The size of every group of digits after the primary group.
protected int $secondaryGroupSize
Результат integer