yii2-如何在主配置中设置货币 [英] yii2 - how to set currency in main config
本文介绍了yii2-如何在主配置中设置货币的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要在配置中将货币格式设置为默认格式.现在,当我在前端更改语言时,货币也在发生变化.如何默认设置
I need to set currency format as default in config. Now when I change language in frontend the currency is changing too. How can I set it by default
推荐答案
在Config/main.php中,例如:
In Config/main.php eg:
'component' => [
..........
'formatter' => [
'class' => 'yii\i18n\Formatter',
'dateFormat' => 'dd.MM.yyyy',
'decimalSeparator' => ',',
'thousandSeparator' => ' ',
'currencyCode' => 'EUR',
'nullDisplay' => '',
],
这篇关于yii2-如何在主配置中设置货币的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文