Revision 7e5216e8
Von Udo Spallek vor etwa 19 Jahren hinzugefügt
SL/Form.pm | ||
---|---|---|
615 | 615 |
$amount = $amount * (10 ** ($places)); |
616 | 616 |
$round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places)); |
617 | 617 |
|
618 |
do {
|
|
619 |
$round_amount =~ s/(0|\.)$//g;
|
|
620 |
$places--;
|
|
621 |
} while ($places > 0);
|
|
622 |
|
|
618 |
while ($places > 0 && $round_amount=~ /\./){
|
|
619 |
$round_amount =~ s/[0]$//g;
|
|
620 |
$places--; |
|
621 |
} ;
|
|
622 |
$round_amount =~ s/\.$//g; |
|
623 | 623 |
$main::lxdebug->leave_sub(); |
624 | 624 |
|
625 | 625 |
return $round_amount; |
Auch abrufbar als: Unified diff
Version2