X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcdr.pm;h=9d72c39e4aa777ca7acc5e1f3d788e70bb079119;hb=b198322c5f3c1d26674ff12f93abf0d55e09f731;hp=de9cf124aa257aae15b39556e81123b2a677a468;hpb=267020ff22d48bb82a02a13525f0e0844ef4d6bd;p=freeside.git diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm index de9cf124a..9d72c39e4 100644 --- a/FS/FS/cdr.pm +++ b/FS/FS/cdr.pm @@ -955,9 +955,15 @@ sub rate_prefix { # this is why we need regionnum/rate_region.... warn " (rate region $rate_region)\n" if $DEBUG; + # NOW round it. + my $rounding = $part_pkg->option_cacheable('rounding') || 2; + my $sprintformat = '%.'. $rounding. 'f'; + my $roundup = 10**(-3-$rounding); + my $price = sprintf($sprintformat, $charge + $roundup); + $self->set_status_and_rated_price( 'rated', - sprintf('%.2f', $charge + 0.000001), # NOW round it. + $price, $opt{'svcnum'}, 'rated_pretty_dst' => $pretty_dst, 'rated_regionname' => $rate_region->regionname,