Re: fractional cents

John Douglas Porter <[email protected]>
Newsgroups gmane.comp.lang.perl.fun
Message-ID <[email protected]>
"A. Pagaltzis" <[email protected]> wrote:
> It's not shorter or more obvious I'm afraid, just a little more
> correct.

The trouble I'm having with this problem is knowing what is
"correct".  It seems to me that the precision desired should
depend on context, and nothing else.  And that being the case...

  printf $fractional_cents ? '%7.3f' : '%7.sf', $amt;

irrespective of the value of $amt.  Why is this not right?

-- 
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.