PHP 클래스 Prado\I18N\core\NumberFormatInfo

Defines how numeric values are formatted and displayed, depending on the culture. Numeric values are formatted using standard or custom patterns stored in the properties of a NumberFormatInfo. This class contains information, such as currency, decimal separators, and other numeric symbols. To create a NumberFormatInfo for a specific culture, create a CultureInfo for that culture and retrieve the CultureInfo->NumberFormat property. Or use NumberFormatInfo::getInstance($culture). To create a NumberFormatInfo for the invariant culture, use the InvariantInfo::getInvariantInfo().
파일 보기 프로젝트 열기: pradosoft/prado 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$pattern array The number pattern.
$properties array A list of properties that are accessable/writable.

공개 메소드들

메소드 설명
__construct ( $data = [], $type = NumberFormatInfo::DECIMAL ) Initializes a new writable instance of the NumberFormatInfo class that is dependent on the ICU data for number, decimal, and currency formatting information. N.B.You should not initialize this class directly unless you know what you are doing. Please use use NumberFormatInfo::getInstance() to create an instance.
__get ( $name ) : mixed Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
__set ( $name, $value ) Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
getCurrencyInstance ( $culture = null ) : NumberFormatInfo Returns the currency format info associated with the specified culture.
getCurrencySymbol ( $currency = 'USD' ) : string Gets the string to use as the currency symbol.
getDecimalDigits ( ) : integer Indicates the number of decimal places.
getDecimalSeparator ( ) : string Gets the string to use as the decimal separator.
getDigitSize ( )
getGroupSeparator ( ) : string Gets the string that separates groups of digits to the left of the decimal in currency values.
getGroupSizes ( ) : array Gets the number of digits in each group to the left of the decimal There can be two grouping sizes, this fucntion returns array(group1, group2), if there is only 1 grouping size, group2 will be false.
getInstance ( $culture = null, $type = NumberFormatInfo::DECIMAL ) : NumberFormatInfo Returns the NumberFormatInfo associated with the specified culture.
getInvariantInfo ( $type = NumberFormatInfo::DECIMAL ) : NumberFormatInfo Gets the default NumberFormatInfo that is culture-independent (invariant).
getNaNSymbol ( ) : string Gets the string that represents the IEEE NaN (not a number) value.
getNegativeInfinitySymbol ( ) : string Gets the string that represents negative infinity.
getNegativePattern ( ) : arary Gets the format pattern for negative values.
getNegativeSign ( ) : string Gets the string that denotes that the associated number is negative.
getPattern ( )
getPerMilleSymbol ( ) : string Gets the string to use as the per mille symbol.
getPercentSymbol ( ) : string Gets the string to use as the percent symbol.
getPercentageInstance ( $culture = null ) : NumberFormatInfo Returns the percentage format info associated with the specified culture.
getPositiveInfinitySymbol ( ) : string Gets the string that represents positive infinity.
getPositivePattern ( ) : arary Gets the format pattern for positive values.
getPositiveSign ( ) : string Gets the string that denotes that the associated number is positive.
getScientificInstance ( $culture = null ) : NumberFormatInfo Returns the scientific format info associated with the specified culture.
setCurrencySymbol ( $symbol ) Set the string to use as the currency symbol.
setDecimalDigits ( $value ) Set the number of decimal places.
setDecimalSeparator ( $value ) Set the string to use as the decimal separator.
setDigitSize ( $value )
setGroupSeparator ( $value ) Set the string to use as the group separator.
setGroupSizes ( $groupSize ) Set the number of digits in each group to the left of the decimal.
setNaNSymbol ( $value ) Set the string that represents the IEEE NaN (not a number) value.
setNegativeInfinitySymbol ( $value ) Set the string that represents negative infinity.
setNegativePattern ( $pattern ) Set the format pattern for negative values.
setNegativeSign ( $value ) Set the string that denotes that the associated number is negative.
setPattern ( $type = NumberFormatInfo::DECIMAL ) Set the pattern for a specific number pattern. The validate patterns NumberFormatInfo::DECIMAL, NumberFormatInfo::CURRENCY, NumberFormatInfo::PERCENTAGE, or NumberFormatInfo::SCIENTIFIC
setPerMilleSymbol ( $value ) Set the string to use as the per mille symbol.
setPercentSymbol ( $value ) Set the string to use as the percent symbol.
setPositiveInfinitySymbol ( $value ) Set the string that represents positive infinity.
setPositivePattern ( $pattern ) Set the format pattern for positive values.
setPositiveSign ( $value ) Set the string that denotes that the associated number is positive.

보호된 메소드들

메소드 설명
getPrePostfix ( $pattern ) : array Get the prefix and postfix of a pattern.
parsePattern ( $pattern ) : array Parse the given pattern and return a list of known properties.

메소드 상세

__construct() 공개 메소드

Initializes a new writable instance of the NumberFormatInfo class that is dependent on the ICU data for number, decimal, and currency formatting information. N.B.You should not initialize this class directly unless you know what you are doing. Please use use NumberFormatInfo::getInstance() to create an instance.
또한 보기: getInstance()
public __construct ( $data = [], $type = NumberFormatInfo::DECIMAL )

__get() 공개 메소드

Allow functions that begins with 'set' to be called directly as an attribute/property to retrieve the value.
public __get ( $name ) : mixed
리턴 mixed

__set() 공개 메소드

Allow functions that begins with 'set' to be called directly as an attribute/property to set the value.
public __set ( $name, $value )

getCurrencyInstance() 공개 정적인 메소드

Returns the currency format info associated with the specified culture.
public static getCurrencyInstance ( $culture = null ) : NumberFormatInfo
리턴 NumberFormatInfo NumberFormatInfo for the specified culture.

getCurrencySymbol() 공개 메소드

Gets the string to use as the currency symbol.
public getCurrencySymbol ( $currency = 'USD' ) : string
리턴 string currency symbol.

getDecimalDigits() 공개 메소드

Indicates the number of decimal places.
public getDecimalDigits ( ) : integer
리턴 integer number of decimal places.

getDecimalSeparator() 공개 메소드

Gets the string to use as the decimal separator.
public getDecimalSeparator ( ) : string
리턴 string decimal separator.

getDigitSize() 공개 메소드

public getDigitSize ( )

getGroupSeparator() 공개 메소드

Gets the string that separates groups of digits to the left of the decimal in currency values.
public getGroupSeparator ( ) : string
리턴 string currency group separator.

getGroupSizes() 공개 메소드

Gets the number of digits in each group to the left of the decimal There can be two grouping sizes, this fucntion returns array(group1, group2), if there is only 1 grouping size, group2 will be false.
public getGroupSizes ( ) : array
리턴 array grouping size(s).

getInstance() 공개 정적인 메소드

Returns the NumberFormatInfo associated with the specified culture.
public static getInstance ( $culture = null, $type = NumberFormatInfo::DECIMAL ) : NumberFormatInfo
리턴 NumberFormatInfo NumberFormatInfo for the specified culture.

getInvariantInfo() 공개 정적인 메소드

Gets the default NumberFormatInfo that is culture-independent (invariant).
public static getInvariantInfo ( $type = NumberFormatInfo::DECIMAL ) : NumberFormatInfo
리턴 NumberFormatInfo default NumberFormatInfo.

getNaNSymbol() 공개 메소드

Gets the string that represents the IEEE NaN (not a number) value.
public getNaNSymbol ( ) : string
리턴 string NaN symbol.

getNegativeInfinitySymbol() 공개 메소드

Gets the string that represents negative infinity.
public getNegativeInfinitySymbol ( ) : string
리턴 string negative infinity.

getNegativePattern() 공개 메소드

The negative pattern is composed of a prefix, and postfix. This function returns array(prefix, postfix).
public getNegativePattern ( ) : arary
리턴 arary negative pattern.

getNegativeSign() 공개 메소드

Gets the string that denotes that the associated number is negative.
public getNegativeSign ( ) : string
리턴 string negative sign.

getPattern() 공개 메소드

public getPattern ( )

getPerMilleSymbol() 공개 메소드

Gets the string to use as the per mille symbol.
public getPerMilleSymbol ( ) : string
리턴 string percent symbol.

getPercentSymbol() 공개 메소드

Gets the string to use as the percent symbol.
public getPercentSymbol ( ) : string
리턴 string percent symbol.

getPercentageInstance() 공개 정적인 메소드

Returns the percentage format info associated with the specified culture.
public static getPercentageInstance ( $culture = null ) : NumberFormatInfo
리턴 NumberFormatInfo NumberFormatInfo for the specified culture.

getPositiveInfinitySymbol() 공개 메소드

Gets the string that represents positive infinity.
public getPositiveInfinitySymbol ( ) : string
리턴 string positive infinity.

getPositivePattern() 공개 메소드

The positive pattern is composed of a prefix, and postfix. This function returns array(prefix, postfix).
public getPositivePattern ( ) : arary
리턴 arary positive pattern.

getPositiveSign() 공개 메소드

Gets the string that denotes that the associated number is positive.
public getPositiveSign ( ) : string
리턴 string positive sign.

getPrePostfix() 보호된 메소드

Get the prefix and postfix of a pattern.
protected getPrePostfix ( $pattern ) : array
리턴 array of prefix and postfix, array(prefix,postfix).

getScientificInstance() 공개 정적인 메소드

Returns the scientific format info associated with the specified culture.
public static getScientificInstance ( $culture = null ) : NumberFormatInfo
리턴 NumberFormatInfo NumberFormatInfo for the specified culture.

parsePattern() 보호된 메소드

Parse the given pattern and return a list of known properties.
protected parsePattern ( $pattern ) : array
리턴 array list of pattern properties.

setCurrencySymbol() 공개 메소드

Set the string to use as the currency symbol.
public setCurrencySymbol ( $symbol )

setDecimalDigits() 공개 메소드

Set the number of decimal places.
public setDecimalDigits ( $value )

setDecimalSeparator() 공개 메소드

Set the string to use as the decimal separator.
public setDecimalSeparator ( $value )

setDigitSize() 공개 메소드

public setDigitSize ( $value )

setGroupSeparator() 공개 메소드

Set the string to use as the group separator.
public setGroupSeparator ( $value )

setGroupSizes() 공개 메소드

There can be two grouping sizes, the value should be an array(group1, group2), if there is only 1 grouping size, group2 should be false.
public setGroupSizes ( $groupSize )

setNaNSymbol() 공개 메소드

Set the string that represents the IEEE NaN (not a number) value.
public setNaNSymbol ( $value )

setNegativeInfinitySymbol() 공개 메소드

Set the string that represents negative infinity.
public setNegativeInfinitySymbol ( $value )

setNegativePattern() 공개 메소드

The negative pattern is composed of a prefix, and postfix in the form array(prefix, postfix).
public setNegativePattern ( $pattern )

setNegativeSign() 공개 메소드

Set the string that denotes that the associated number is negative.
public setNegativeSign ( $value )

setPattern() 공개 메소드

Set the pattern for a specific number pattern. The validate patterns NumberFormatInfo::DECIMAL, NumberFormatInfo::CURRENCY, NumberFormatInfo::PERCENTAGE, or NumberFormatInfo::SCIENTIFIC
public setPattern ( $type = NumberFormatInfo::DECIMAL )

setPerMilleSymbol() 공개 메소드

Set the string to use as the per mille symbol.
public setPerMilleSymbol ( $value )

setPercentSymbol() 공개 메소드

Set the string to use as the percent symbol.
public setPercentSymbol ( $value )

setPositiveInfinitySymbol() 공개 메소드

Set the string that represents positive infinity.
public setPositiveInfinitySymbol ( $value )

setPositivePattern() 공개 메소드

The positive pattern is composed of a prefix, and postfix in the form array(prefix, postfix).
public setPositivePattern ( $pattern )

setPositiveSign() 공개 메소드

Set the string that denotes that the associated number is positive.
public setPositiveSign ( $value )

프로퍼티 상세

$pattern 보호되어 있는 프로퍼티

The number pattern.
protected array $pattern
리턴 array

$properties 보호되어 있는 프로퍼티

A list of properties that are accessable/writable.
protected array $properties
리턴 array