From 7e5216e842111fc73b6d7fe62b16337ccc720939 Mon Sep 17 00:00:00 2001 From: Udo Spallek Date: Thu, 27 Oct 2005 02:16:29 +0000 Subject: [PATCH] Version2 --- SL/Form.pm | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index eeb470e70..251b0485e 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -615,11 +615,11 @@ sub round_amount { $amount = $amount * (10 ** ($places)); $round_amount = int($amount + .5 * ($amount <=> 0))/(10**($places)); - do { - $round_amount =~ s/(0|\.)$//g; - $places--; - } while ($places > 0); - + while ($places > 0 && $round_amount=~ /\./){ + $round_amount =~ s/[0]$//g; + $places--; + } ; + $round_amount =~ s/\.$//g; $main::lxdebug->leave_sub(); return $round_amount; -- 2.20.1