Revision e3232a58
Von Udo Spallek vor etwa 17 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
726 | 726 |
if ($amount eq "") { |
727 | 727 |
$amount = 0; |
728 | 728 |
} |
729 |
my $neg = ($amount =~ s/-//); |
|
730 |
|
|
729 |
|
|
730 |
# Hey watch out! The amount can be an exponential term like 1.13686837721616e-13 |
|
731 |
|
|
732 |
my $neg = ($amount =~ s/^-//); |
|
733 |
my $exp = ($amount =~ m/[e]/) ? 1 : 0; |
|
734 |
|
|
731 | 735 |
if (defined($places) && ($places ne '')) { |
732 |
if ($places < 0) { |
|
733 |
$amount *= 1; |
|
734 |
$places *= -1; |
|
735 |
|
|
736 |
my ($actual_places) = ($amount =~ /\.(\d+)/); |
|
737 |
$actual_places = length($actual_places); |
|
738 |
$places = $actual_places > $places ? $actual_places : $places; |
|
736 |
if (not $exp) { |
|
737 |
if ($places < 0) { |
|
738 |
$amount *= 1; |
|
739 |
$places *= -1; |
|
740 |
|
|
741 |
my ($actual_places) = ($amount =~ /\.(\d+)/); |
|
742 |
$actual_places = length($actual_places); |
|
743 |
$places = $actual_places > $places ? $actual_places : $places; |
|
744 |
} |
|
739 | 745 |
} |
740 |
|
|
741 | 746 |
$amount = $self->round_amount($amount, $places); |
742 | 747 |
} |
743 | 748 |
|
... | ... | |
863 | 868 |
qw(company address signature)); |
864 | 869 |
map({ $self->{$_} =~ s/\\n/\n/g; } qw(company address signature)); |
865 | 870 |
|
871 |
map({ $self->{"${_}"} = $myconfig->{$_}; } |
|
872 |
qw(co_ustid)); |
|
873 |
|
|
874 |
|
|
866 | 875 |
$self->{copies} = 1 if (($self->{copies} *= 1) <= 0); |
867 | 876 |
|
868 | 877 |
# OUT is used for the media, screen, printer, email |
Auch abrufbar als: Unified diff
1. Fieser Bug der in format_amount auftritt, wenn eine sehr kleine Zahl in Exponentialschreibweise uebergeben
wird wie bspw. 1.13686837721616e-13. BITTE UNBEDINGT PRUEFEN, TESTEN UND VERBESSERN.
Siehe auch Forenbeitrag: http://lx-office.org/forum/forum_entry.php?id=5315
2. co_ustid in allen Dokumenten zur Verfuegung gestellt.