Property | Type | Description | |
---|---|---|---|
$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. |
Method | Description | |
---|---|---|
__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 ) |
Method | Description | |
---|---|---|
replaceDigits ( string $value ) : string | Replaces digits with their localized equivalents. | |
replaceSymbols ( string $value ) : string | Replaces number symbols with their localized equivalents. |
public __construct ( CommerceGuys\Intl\NumberFormat\NumberFormatInterface $numberFormat, integer $style = self::DECIMAL ) | ||
$numberFormat | CommerceGuys\Intl\NumberFormat\NumberFormatInterface | The number format. |
$style | integer | The formatting style. |
public formatCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency ) | ||
$currency | CommerceGuys\Intl\Currency\CurrencyInterface |
public parseCurrency ( $value, CommerceGuys\Intl\Currency\CurrencyInterface $currency ) | ||
$currency | CommerceGuys\Intl\Currency\CurrencyInterface |
protected replaceDigits ( string $value ) : string | ||
$value | string | The value being formatted. |
return | string |
protected replaceSymbols ( string $value ) : string | ||
$value | string | The value being formatted. |
return | string |
protected int $currencyDisplay | ||
return | integer |
protected bool $groupingUsed | ||
return | boolean |
protected int $maximumFractionDigits | ||
return | integer |
protected int $minimumFractionDigits | ||
return | integer |
protected string $negativePattern | ||
return | string |
protected NumberFormatInterface,CommerceGuys\Intl\NumberFormat $numberFormat | ||
return | CommerceGuys\Intl\NumberFormat\NumberFormatInterface |
protected string $positivePattern | ||
return | string |
protected int $primaryGroupSize | ||
return | integer |
protected int $secondaryGroupSize | ||
return | integer |