Needs review
Project:
Table Wizard
Version:
6.x-1.2
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
1 Jul 2010 at 23:32 UTC
Updated:
2 Jul 2010 at 00:39 UTC
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
Comment #1
3dloco commentedRather
if ($coltype = 'numeric'){