]> wagnertech.de Git - kivitendo-erp.git/blobdiff - SL/Form.pm
Merge von 705 aus unstable: format_amount
[kivitendo-erp.git] / SL / Form.pm
index a0fa96a2ce6283852b21cd913aa8da349369a22c..c5a30bf781fd2e6ba2f8bf854587b1a627dd322f 100644 (file)
@@ -519,6 +519,12 @@ sub format_amount {
   $main::lxdebug->enter_sub();
 
   my ($self, $myconfig, $amount, $places, $dash) = @_;
+  
+  #Workaround for $format_amount calls without $places
+  if (!defined $places){
+  (my $dec) = ($amount =~ /\.(\d+)/);
+  $places           = length $dec;
+  }                    
 
   if ($places =~ /\d/) {
     $amount = $self->round_amount($amount, $places);