PHP 클래스 CommerceGuys\Intl\Formatter\NumberFormatter

상속: implements CommerceGuys\Intl\Formatter\NumberFormatterInterface
파일 보기 프로젝트 열기: commerceguys/intl 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$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