Revision 2d75060f
Von Sven Schöling vor fast 13 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
852 | 852 |
$main::lxdebug->enter_sub(2); |
853 | 853 |
|
854 | 854 |
my ($self, $myconfig, $amount, $places, $dash) = @_; |
855 |
$dash ||= ''; |
|
855 | 856 |
|
856 | 857 |
if ($amount eq "") { |
857 | 858 |
$amount = 0; |
... | ... | |
868 | 869 |
$amount *= 1; |
869 | 870 |
$places *= -1; |
870 | 871 |
|
871 |
my ($actual_places) = ($amount =~ /\.(\d+)/); |
|
872 |
$actual_places = length($actual_places); |
|
873 |
$places = $actual_places > $places ? $actual_places : $places; |
|
872 |
if ($amount =~ /\.(\d+)/) { |
|
873 |
my $actual_places = length $1; |
|
874 |
$places = $actual_places if $actual_places > $places; |
|
875 |
} |
|
874 | 876 |
} |
875 | 877 |
} |
876 | 878 |
$amount = $self->round_amount($amount, $places); |
... | ... | |
882 | 884 |
$p[0] =~ s/\B(?=(...)*$)/$d[1]/g if $d[1]; # add 1,000 delimiters |
883 | 885 |
|
884 | 886 |
$amount = $p[0]; |
885 |
$amount .= $d[0].$p[1].(0 x ($places - length $p[1])) if ($places || $p[1] ne '');
|
|
887 |
$amount .= $d[0].($p[1]||'').(0 x ($places - length ($p[1]||''))) if ($places || $p[1] ne '');
|
|
886 | 888 |
|
887 | 889 |
$amount = do { |
888 | 890 |
($dash =~ /-/) ? ($neg ? "($amount)" : "$amount" ) : |
Auch abrufbar als: Unified diff
SL::Form: Zwei Warnings unterdrücken.
Warnungen tauchen auf in format_amount, wenn paramtere $dash fehlte, und wenn
ohne Nachkommastellen formatiert wurde.