-1

I am using view aggregation plus and views calc. I have calculate duration by subtracting two dates and display it with 1 decimal point. it work fine.

then I use sum function of view aggregation plus on views calc column to have total duration, everything work fine, but the result is with 4 decimal point i.e. 5.2302 it should display it as 5.2 only.

any suggestion how to set the decimal points of result of sum in view aggregation plus? I believe the problem is somewhere in view aggregation plus output formatting.

1 Answer 1

0

You could add a php field to your view. Then hide the actual calc field from display and formatt the rounding in your php field:

<?php echo round($data->field_data_field_rating_field_rating_value,1); ?>
2
  • 1
    I think aggregation plus should have an option to round the sum. having a new column with php field may be the solution but then I don't need calc field , why i would just hide? remember calc field calculate the duration of each record the aggregation sum up all the duration at the bottom of the view.
    – user21354
    Feb 25, 2014 at 6:17
  • i tried view php module it gives global:php where I use code to calculate duration and able to use round function. But the problem is that I can't find how to expose this field's filter to the user? working with date and duration in drupal causing me headache.
    – user21354
    Feb 25, 2014 at 12:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.