问题
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.
回答1:
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.
回答2:
here i am assuming that you are using span for value and currency. you can check the fiddle.
html :
<span>10 000,00</span>
<span class="currency">€</span>
CSS :
.currency{
float: left;
}
jsfiddle
来源:https://stackoverflow.com/questions/32992414/how-to-format-currency-sign-in-yii2-after-the-value