Commit f7488579 by leandrogehlen

Renamed Formatter::intlCurrencySymbol to currencySymbol

parent 4ecbd201
...@@ -77,7 +77,7 @@ class Formatter extends \yii\base\Formatter ...@@ -77,7 +77,7 @@ class Formatter extends \yii\base\Formatter
* @var string the international curency symbol displayed when formatting a number. * @var string the international curency symbol displayed when formatting a number.
* If not set, the thousand separator corresponding to [[locale]] will be used. * If not set, the thousand separator corresponding to [[locale]] will be used.
*/ */
public $intlCurrencySymbol; public $currencySymbol;
/** /**
* Initializes the component. * Initializes the component.
...@@ -93,7 +93,7 @@ class Formatter extends \yii\base\Formatter ...@@ -93,7 +93,7 @@ class Formatter extends \yii\base\Formatter
if ($this->locale === null) { if ($this->locale === null) {
$this->locale = Yii::$app->language; $this->locale = Yii::$app->language;
} }
if ($this->decimalSeparator === null || $this->thousandSeparator === null || $this->intlCurrencySymbol === null) { if ($this->decimalSeparator === null || $this->thousandSeparator === null || $this->currencySymbol === null) {
$formatter = new NumberFormatter($this->locale, NumberFormatter::DECIMAL); $formatter = new NumberFormatter($this->locale, NumberFormatter::DECIMAL);
if ($this->decimalSeparator === null) { if ($this->decimalSeparator === null) {
$this->decimalSeparator = $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL); $this->decimalSeparator = $formatter->getSymbol(NumberFormatter::DECIMAL_SEPARATOR_SYMBOL);
...@@ -101,8 +101,8 @@ class Formatter extends \yii\base\Formatter ...@@ -101,8 +101,8 @@ class Formatter extends \yii\base\Formatter
if ($this->thousandSeparator === null) { if ($this->thousandSeparator === null) {
$this->thousandSeparator = $formatter->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL); $this->thousandSeparator = $formatter->getSymbol(NumberFormatter::GROUPING_SEPARATOR_SYMBOL);
} }
if ($this->intlCurrencySymbol === null) { if ($this->currencySymbol === null) {
$this->intlCurrencySymbol = $formatter->getSymbol(NumberFormatter::INTL_CURRENCY_SYMBOL); $this->currencySymbol = $formatter->getSymbol(NumberFormatter::INTL_CURRENCY_SYMBOL);
} }
} }
...@@ -276,7 +276,7 @@ class Formatter extends \yii\base\Formatter ...@@ -276,7 +276,7 @@ class Formatter extends \yii\base\Formatter
} }
if ($currency === null){ if ($currency === null){
$currency = $this->intlCurrencySymbol; $currency = $this->currencySymbol;
} }
return $this->createNumberFormatter(NumberFormatter::CURRENCY, $format)->formatCurrency($value, $currency); return $this->createNumberFormatter(NumberFormatter::CURRENCY, $format)->formatCurrency($value, $currency);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment