C
C
Christopher Carter2021-04-11 19:03:41
Yii
Christopher Carter, 2021-04-11 19:03:41

Where are the formatting settings of the Yii::$app->formatter->asCurrency function?

The same execution of the Yii::$app->formatter->asCurrency function on the server produces the result

RUB 150.00 or $150.00

And on the local

RUB 150.00 or USD 150.00

The code itself

echo \Yii::$app->formatter->asCurrency(150); // аргумент 'RUB' ничего не изменяет
//также пробовал 'USD', результат выше

The only thing I could find that can affect this is the part of the config in common/config/main.php, but it is completely the same on the server and on the local. I also noticed that in the console / controllers functions, the server also gives the result, as on a local server (with RUB).

'formatter' => [
    'class' => 'yii\i18n\Formatter',
    'dateFormat' => 'dd.MM.yyyy',
    'decimalSeparator' => ',',
    'thousandSeparator' => ' ',
    'currencyCode' => 'RUB',
    'locale' => 'ru-RU',
],

What could be the problem and where to dig / how to treat?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Bay, 2021-04-11
@kawabanga

https://www.yiiframework.ru/forum/viewtopic.php?t=42460

https://www.yiiframework.ru/forum/viewtopic.php?t=42460

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question