I am working with Yii and I have the following situation:
I have a MySQL table:
charges {
id INT AUTOINCREMENT,
name VARCHAR(256),
value DOUBLE
}
Then I have the model from this table. And finally I have the views for create, list, admin, update and view.
In the admin and view views I want to display the value
field formated with two decimal numbers. One option to do this could be in the view and admin files format the number. Is there a way to create a method in the model and then not having to do anything in the views but the method itself will solve formating the number?
thanks