Decimal Type showing as Integer

edited February 2014 in Bug Reports
In my advanced module, my decimal field seems to be treated as an integer in the controller.

In the simple module create form the decimal shows fine, even after save.
However, when that data is pulled by a controller it seems to lose its decimal.

Looking at the field types in the forms section of the user guide, I see that for field type number decimals are disallowed by default.

So, I tried:
class Leads_model extends Base_module_model { ... function form_fields($values = array(), $related = array()){ $fields = parent::form_fields($values, $related); $fields['cost'] = array('type' => 'number', 'negative' => TRUE, 'decimal' => TRUE); return $fields; }

However, the problem wasn't in the form, but rather the controller when trying to display the data.

Any advice on working with decimals in Fuel?

class Orders extends Fuel_base_controller { ... $leads = $this->leads_model->find_all(array('order_id' => $id)); echo $leads[0]->cost; die();Produces: 30
Expects: 30.95


Sign In or Register to comment.