[freeside-commits] branch master updated. aae697565c071b2880d0106b00a4a01d0ddab7bf

Mark Wells mark at 420.am
Tue Sep 3 12:48:04 PDT 2013


The branch, master has been updated
       via  aae697565c071b2880d0106b00a4a01d0ddab7bf (commit)
      from  35d24c449337f95d0e2174cbed55b53eb6c32ca2 (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 aae697565c071b2880d0106b00a4a01d0ddab7bf
Author: Mark Wells <mark at freeside.biz>
Date:   Tue Sep 3 12:47:33 2013 -0700

    477 report: state percentages to 3 decimal places, #24834

diff --git a/httemplate/search/477partIA.html b/httemplate/search/477partIA.html
index 1cd0b70..5ee44da 100755
--- a/httemplate/search/477partIA.html
+++ b/httemplate/search/477partIA.html
@@ -139,7 +139,7 @@ for ( my $row = 0; $row < scalar @upload_option; $row++ ) {
     my $count = FS::Record->scalar_sql($this_count_query);
     my $residential = FS::Record->scalar_sql($this_count_query . $is_residential);
 
-    my $percent = sprintf('%.2f', $count ? 100 * $residential / $count : 0);
+    my $percent = sprintf('%.3f', $count ? 100 * $residential / $count : 0);
     $data[$col][$row] = [ $count, $percent ];
 
     $total_count += $count;
@@ -149,10 +149,10 @@ for ( my $row = 0; $row < scalar @upload_option; $row++ ) {
 }
 
 my $total_percentage =
-  sprintf("%.2f", $total_count ? 100*$total_residential/$total_count : 0);
+  sprintf("%.3f", $total_count ? 100*$total_residential/$total_count : 0);
 
 my $above_200_percentage =
-  sprintf("%.2f", $total_count ? 100*$above_200/$total_count : 0);
+  sprintf("%.3f", $total_count ? 100*$above_200/$total_count : 0);
 
 my @summary_row = (
   $total_count,
diff --git a/httemplate/search/477partIIA.html b/httemplate/search/477partIIA.html
index 95c00a3..907a176 100755
--- a/httemplate/search/477partIIA.html
+++ b/httemplate/search/477partIIA.html
@@ -104,7 +104,7 @@ if ( $total_lines > 0 ) {
   foreach (@row_conds) {
     my $sql = $query_ds0 . $_;
     my $lines = FS::Record->scalar_sql($sql);
-    my $percent = sprintf('%.2f', 100 * $lines / $total_lines);
+    my $percent = sprintf('%.3f', 100 * $lines / $total_lines);
     push @{ $data[0] }, $percent;
   }
 }
diff --git a/httemplate/search/477partIIB.html b/httemplate/search/477partIIB.html
index 5b9b307..cb181f4 100755
--- a/httemplate/search/477partIIB.html
+++ b/httemplate/search/477partIIB.html
@@ -120,7 +120,7 @@ foreach (@col_conds) {
       if ( $col_data[0] == 0 ) {
         $col_data[$row] = ''; # show nothing in this row, then
       } else {
-        $col_data[$row] = sprintf('%.2f', 100 * $count / $col_data[0]) . '%';
+        $col_data[$row] = sprintf('%.3f', 100 * $count / $col_data[0]) . '%';
       }
     } #if $row == 0
     $row++;
diff --git a/httemplate/search/477partVI_census.html b/httemplate/search/477partVI_census.html
index 59a6fb5..0dafc6b 100755
--- a/httemplate/search/477partVI_census.html
+++ b/httemplate/search/477partVI_census.html
@@ -75,7 +75,7 @@ push @fields,
         $state_pkgcount{$state} += $row->quantity;
         $row->quantity;
       },
-  sub { my $row = shift; sprintf "%.2f", $row->residential },
+  sub { my $row = shift; sprintf "%.3f", $row->residential },
 ;
 
 my %search_hash = ();

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

Summary of changes:
 httemplate/search/477partIA.html        |    6 +++---
 httemplate/search/477partIIA.html       |    2 +-
 httemplate/search/477partIIB.html       |    2 +-
 httemplate/search/477partVI_census.html |    2 +-
 4 files changed, 6 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list