[freeside-commits] branch FREESIDE_3_BRANCH updated. 81ffe1d0f3f0201c9392bb5555134d65b0ce33c6

Ivan ivan at 420.am
Tue Sep 3 22:51:42 PDT 2013


The branch, FREESIDE_3_BRANCH has been updated
       via  81ffe1d0f3f0201c9392bb5555134d65b0ce33c6 (commit)
      from  d64453a468d6477aaf62e0bfc10e30cfe9f836b6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 81ffe1d0f3f0201c9392bb5555134d65b0ce33c6
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Tue Sep 3 22:51:41 2013 -0700

    rounding

diff --git a/FS/FS/cdr.pm b/FS/FS/cdr.pm
index de9cf12..9d72c39 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,

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/cdr.pm |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)




More information about the freeside-commits mailing list