Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 7247d23a

Von Udo Spallek vor fast 19 Jahren hinzugefügt

  • ID 7247d23a2badb87bf894346ec5d211ac568f23ad
  • Vorgänger fe0f6f38
  • Nachfolger 69c4afb7

Darstellungsfehler bei Ganzzahlen behoben. Vorher wurde bspw. '2' als '2,' dargestellt, nun wird richtig formatiert.

Unterschiede anzeigen:

SL/Form.pm
540 540
        $amount =~ s/\d{3,}?/$&,/g;
541 541
        $amount =~ s/,$//;
542 542
        $amount = join '', reverse split //, $amount;
543
        $amount .= "\.$dec".$fillup;
543
        $amount .= "\.$dec".$fillup if ($places ne '' && $places*1 != 0);
544 544
      }
545 545

  
546 546
      if ($myconfig->{numberformat} eq '1.000,00') {
547 547
        $amount =~ s/\d{3,}?/$&./g;
548 548
        $amount =~ s/\.$//;
549 549
        $amount = join '', reverse split //, $amount;
550
        $amount .= ",$dec" .$fillup;
550
        $amount .= ",$dec".$fillup if ($places ne '' && $places*1 != 0);
551 551
      }
552 552

  
553 553
      if ($myconfig->{numberformat} eq '1000,00') {
554 554
        $amount = "$whole";
555
        $amount .= ",$dec" .$fillup;
555
        $amount .= ",$dec" .$fillup if ($places ne '' && $places*1 != 0);
556 556
      }
557 557

  
558 558
      if ($dash =~ /-/) {
......
610 610
  # Descr. http://de.wikipedia.org/wiki/Rundung
611 611
  # Inspired by 
612 612
  # http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q4.13.html
613
  # Version 1.0 try to solve Bug: 189
613
  # Solves Bug: 189
614 614
  # Udo Spallek
615 615
  $amount       = $amount * (10 ** ($places));
616 616
  $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places));
617
  
617

  
618 618
  $main::lxdebug->leave_sub();
619 619

  
620 620
  return $round_amount;
621
  
621 622
}
622 623

  
623 624

  

Auch abrufbar als: Unified diff