Reputation: 67
I have this in config:
'formatter' => [
'dateFormat' => 'yyyy-MM-dd',
'decimalSeparator' => ',',
'thousandSeparator' => '.',
'currencyCode' => 'EUR',
],
This print €20.000,00 but I want 20.000,00€ (with € in end).
Who I do this in yii2?
Upvotes: 2
Views: 1481
Reputation: 196
You should set this config:
Yii::$app->formatter->locale = 'et-EE';
With this is enough.
Upvotes: 2
Reputation: 25312
This simply means you need to enable PHP internationalization extension (aka intl
) on your server : http://php.net/manual/en/book.intl.php
Read more about \yii\i18n\Formatter::asCurrency()
:
This function does not require the PHP intl extension to be installed to work, but it is highly recommended to install it to get good formatting results.
Read more about PHP internationalization extension installation.
For example, to install it on Debian :
sudo apt-get install php5-intl
Don't forget to restart your web server after.
Upvotes: 1