Re: fractional cents

John Douglas Porter <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
Bernie Cosell <[email protected]> wrote:
> ...
> And so for 'normal prices' I want them printed normally, and only
> the fractional-prices should print with the extra digit...

O.k., so, if the representation with three decimal places would
have a zero in the last place, chop off the zero, right?
It's that simple?

  $s = sprintf "%7.3f", $amt;
  $s =~ s/(\.\d\d)0/$1/;

No?  (Sorry I'm la[tm]e, if this has already been covered.)

-- 
John Douglas Porter




	
		
__________________________________
Do you Yahoo!?
Yahoo! Photos: High-quality 4x6 digital prints for 25¢
http://photos.yahoo.com/ph/print_splash
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.