⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

thousands separator and sorting issue



wisp2k

wisp2k
  • profile picture
  • Member

Posted 03 March 2015 - 09:10 AM

Hi everybody,

this is my question:

 

I've a float value in my DB

price= 120000

 

I need to show it formatted into the column price

price

120.000

 

to do it I use this callback function

 

$crud->callback_column('price',array($this,'valueToK0'));

 

 

public function valueToK0($value, $row)
{
         return number_format($value, 0, ',', '.');
}

 

of course I put into my column a string, not a number so the sorting function doesn't work: prices values are sorted as string and not as numbers... :(

Is there someone that already solved this issue? HELP Many thanks!

 


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 05 March 2015 - 05:41 AM

Sorry brother -dont think much of work have gone around on the same but then if you need it.. u need to write your custom model for the same and manage it.