Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to format currency sign in Yii2 after the value?

Tags:

formatter

yii2

Right now when I have defined the currencyCode, the currency sign appears in front of the value like €10 000,00, but I'd like to have it like 10 000,00€. How to do that?

At the moment I'm printing '€' separately after the value, but I'm just wondering if there's any way to automate the process.

like image 809
jeesus Avatar asked Oct 07 '15 12:10

jeesus


1 Answers

I was able to resolve this issue installing php5-intl and using this way

Yii::$app->formatter->locale = 'et-EE';
echo Yii::$app->formatter->asCurrency(1202.57, 'EUR');

It will change the sign according to the locale.

like image 178
Felipe Costa Avatar answered Dec 23 '22 21:12

Felipe Costa