]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
format_amount - negative 0 vermeiden
[kivitendo-erp.git] / SL / Form.pm
index 9045d78ca3a2c719b205f4d61d5a3b10e83a2b01..35b21d5a291cace26da7d823eb8456324b74882d 100644 (file)
@@ -822,6 +822,7 @@ sub format_amount {
   my $force_places = defined $places && $places >= 0;
 
   $amount = $self->round_amount($amount, abs $places) if $force_places;
+  $neg    = 0 if $amount == 0; # don't show negative zero
   $amount = sprintf "%.*f", ($force_places ? $places : 10), abs $amount; # 6 is default for %fa
 
   # before the sprintf amount was a number, afterwards it's a string. because of the dynamic nature of perl