In addition to using the correct views handlers as in #742720: Using correct Views handlers, can you modify the field views handler to be able to set the precision (round option) when the field is numeric, like for decimals and currency....

This is what I did to make it work....I added 'float'=>TRUE to the field views handler when the field is numeric (as per #480938: decimal precision).

So on tw_tablebuild.inc v 1.1.2.17
1) Add some condition to check if the field is numeric and set the float value accordingly (add this somewhere before line 101)

if($colrow->type = 'numberic'){
   $floatvalue = TRUE;
}
else {
   $floatvalue = FALSE;
}

2) Then at around line 106 add the 'float'=> $floatvalue to the field array...

'field' =>array(
     'handler'=> _tw_view_handler_($colrow->coltype, 'field'),
     'click sortable' => TRUE,
     'float' => $floatvalue,
),

Thanks,

KH

Comments

3dloco’s picture

Rather if ($coltype = 'numeric'){