Revision ac0c6a86
Von Moritz Bunkus vor fast 18 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
653 | 653 |
} |
654 | 654 |
my $neg = ($amount =~ s/-//); |
655 | 655 |
|
656 |
$amount = $self->round_amount($amount, $places) if ($places =~ /\d/); |
|
656 |
if (defined($places)) { |
|
657 |
if ($places < 0) { |
|
658 |
$amount *= 1; |
|
659 |
$places *= -1; |
|
660 |
|
|
661 |
my ($actual_places) = ($amount =~ /\.(\d+)/); |
|
662 |
$actual_places = length($actual_places); |
|
663 |
$places = $actual_places > $places ? $actual_places : $places; |
|
664 |
} |
|
665 |
|
|
666 |
$amount = $self->round_amount($amount, $places); |
|
667 |
} |
|
657 | 668 |
|
658 | 669 |
my @d = map { s/\d//g; reverse split // } my $tmp = $myconfig->{numberformat}; # get delim chars |
659 | 670 |
my @p = split(/\./, $amount); # split amount at decimal point |
Auch abrufbar als: Unified diff
Neues Feature: Wenn die Anzahl Dezimalstellen bei format_amount() negativ ist, dann werden mindestens (und nicht exakt) so viele Stellen angezeigt.