Author: spadkins
Date: Thu Feb 26 11:38:33 2009
New Revision: 12547

Modified:
   p5ee/trunk/App-Widget/lib/App/Widget.pm

Log:
showing -0 and +0. It should be just 0

Modified: p5ee/trunk/App-Widget/lib/App/Widget.pm
==============================================================================
--- p5ee/trunk/App-Widget/lib/App/Widget.pm     (original)
+++ p5ee/trunk/App-Widget/lib/App/Widget.pm     Thu Feb 26 11:38:33 2009
@@ -580,6 +580,7 @@
                 }
                 else {
                     $formatted_value = int($formatted_value);
+
                     if ($int =~ /,/) {
                         $formatted_value =~ s/([0-9])([0-9][0-9][0-9])$/$1,$2/;
                         while ($formatted_value =~ 
s/([0-9])([0-9][0-9][0-9]),/$1,$2,/) {
@@ -605,12 +606,12 @@
                     if ($paren) {
                         $formatted_value = "(" . $formatted_value . ")";
                     }
-                    elsif ($sign && $value < 0) {
+                    elsif ($sign && $formatted_value < 0) {
                         $formatted_value = "-" . $formatted_value;
                     }
                 }
                 else {
-                    if ($sign && $value > 0) {
+                    if ($sign && $formatted_value > 0) {
                         $formatted_value = "+" . $formatted_value;
                     }
                 }

Reply via email to