All pastes #235668 Raw Edit

Untitled

public text v1 · immutable
·published 2006-11-03 11:36 UTC
rendered paste body
sub calccost() {
        my ($adjconn, $adjcost, $answeredtime, $increment) = @_;
        my $cost;
        $increment = 60; #Added by sadaat-Handle Billing Increment
        my $adjtime = eval { $adjtime = int((($answeredtime - $numdata->{includedseconds}) + $increment - 1) / $increment) * $increment;
                return $adjtime };

        if ($adjtime < 0) {
                $adjtime = 0;
        }
        print STDERR "Adjusted time is $adjtime, cost is $adjcost with $adjconn fee\n";
        $cost = ($adjcost * $adjtime / 60) + $adjconn; #Changed
#       eval { $cost = int($adjcost * $adjtime / 60) };
#       $cost += $adjconn;
        print STDERR "Total cost is $cost\n";

        return $cost;
}