You can use YII2’s built in formatter to format any arbitrary value you like. For example, you may want to format the footer of a grid view as currency. When specifying the cell, you can set the format of that cell. However, while you can control what will be in the footer for that column, GridView does not have a method of formatting the footer values.
Here is a simple method to format any value.
- $formatter = new \yii\i18n\Formatter;
- $formatted_value = $formatter->asCurrency($value);