Revision ac0c6a86
Von Moritz Bunkus vor etwa 18 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
}
|
||
my $neg = ($amount =~ s/-//);
|
||
|
||
$amount = $self->round_amount($amount, $places) if ($places =~ /\d/);
|
||
if (defined($places)) {
|
||
if ($places < 0) {
|
||
$amount *= 1;
|
||
$places *= -1;
|
||
|
||
my ($actual_places) = ($amount =~ /\.(\d+)/);
|
||
$actual_places = length($actual_places);
|
||
$places = $actual_places > $places ? $actual_places : $places;
|
||
}
|
||
|
||
$amount = $self->round_amount($amount, $places);
|
||
}
|
||
|
||
my @d = map { s/\d//g; reverse split // } my $tmp = $myconfig->{numberformat}; # get delim chars
|
||
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.