Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
numaric sort for monitor detail page
#1
hi,

I think ascending and descending sort in data column in "Monitor Details" should be numaric sort.because most of the time we received numeric values as data and numeric sort has greater importance than string sort in this case.so i changed few lines in code to get that and it is working fine i guess.

Code:
551c551,552
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'ASC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'ASC');
555c556,557
<                               $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
---
>                               // $order = array('field' => 'tagente_estado.datos', 'order' => 'DESC');
>                               $order = array('field' => 'CAST(tagente_estado.datos AS DECIMAL(12,2))', 'order' => 'DESC');

Regards
 Reply


Users browsing this thread: 1 Guest(s)


(c) 2006-2018 Artica Soluciones Tecnológicas. Contents of this wiki are under Create Common Attribution v3 licence. | pandorafms.com | pandorafms.org

Theme © MyBB Themes