Can I have number fields with commas?
- Single Page
Posted 01 January 2013 - 17:02 PM
Is there some way to allow commas to be entered in the number field but stripped before the item is saved? I've poked around but can't figure out where GroceryCrud prevents anything but numbers from being entered.
Ideally the flow would be something like this:
Read number field from database
Automatically populate with commas
Automatically adjust commas if field is edited
On save, strip commas and then submit
Posted 02 January 2013 - 08:12 AM
$crud->callback_column('price',array($this,'format_num'));
and add this function :
function format_num($value, $row){
return number_format($value, 0);
}
Posted 03 January 2013 - 23:08 PM
That results in a formatted field, like I want, however it is not editable. I need this field to be editable.