- $seconds += $granularity - ( $seconds % $granularity )
- if $seconds # don't granular-ize 0 billsec calls (bills them)
- && $granularity; # 0 is per call
- my $minutes = sprintf("%.1f", $seconds / 60);
+ if ( $seconds && $granularity ) {
+ # don't granular-ize 0 billsec calls (bills them)
+ # 0 granularity is per call
+ $seconds += $granularity - ( $seconds % $granularity );
+ $charge_sec += $granularity - ( $charge_sec % $granularity );
+ }
+
+ my $minutes = sprintf("%.1f", $charge_sec / 60);