* Bernie Cosell <[EMAIL PROTECTED]> [2004-04-19 23:32]:
> I'll confess that I took the coward's way out:
> 
>    $money = sprintf "%7.3f", $amt;
>    $money =~ s/0$// ;
>

Doh. My own code was needlessly complex because I was working
from the assumption that there may be no fractional part at all,
in which case your approach would potentially be dangerous, as it
doesn't only chop 1.230 into 1.23, it would also happily chop 10
to 1. Oops. Well, "oops" if it ever got such input, but I
overlooked the fact that the printf format in use guarantees the
presence of a fractional part.

-- 
Regards,
Aristotle
 
"If you can't laugh at yourself, you don't take life seriously enough."

Reply via email to