Hello all,
in my cgridview I have a custom column like this:
'columns'=>array(
array(
'name'=>'sharedUtilitiesParticipationMilimeters',
//'type'=>'raw',
'value'=>$totals['sharedUtilitiesParticipationMilimeters'],
'htmlOptions'=>(bccomp($totals['sharedUtilitiesParticipationMilimeters'], 1000.00, 2) == 0) ?
array('size'=>10,'width'=>'60px')
: ((bccomp($totals['sharedUtilitiesParticipationMilimeters'], 0.00, 2) == 0) ? array('size'=>10,'width'=>'60px', 'style'=>'background-color:red') : array('size'=>10,'width'=>'60px','style'=>'color:red')),
),
),
that displays a decimal value of 16.2
while the same value when put on a textfield:
<?php echo CHtml::textField('sharedUtilitiesParticipationMilimeters', $totals['sharedUtilitiesParticipationMilimeters'],
(bccomp($totals['sharedUtilitiesParticipationMilimeters'], 1000.00, 2) == 0) ?
array('size'=>10,'disabled'=>true)
: ((bccomp($totals['sharedUtilitiesParticipationMilimeters'], 0.00, 2) == 0) ? array('size'=>10,'disabled'=>true, 'style'=>'background-color:red') : array('size'=>10,'disabled'=>true,'style'=>'color:red'))
);
?>
it displays 16.20 .
My desire is to keep the trailing zero inside the custom column of the grid. Can someone explain why is this happening please? Thanks in advance.
mike