Re: Math Weirdness

From: Date: Mon, 14 Jul 2008 20:11:48 +0000
Subject: Re: Math Weirdness
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-276788@lists.php.net to get a copy of this message
On Mon, 2008-07-14 at 15:00 -0500, Daniel Kolbo wrote: > > > > I don't quite understand your problem, but I use integers for any monetary > > workings as you can guarantee it is accurate (obviously, you work in pence > > or cents rather than GBP or USD). > > > > > > > > Alex > > > > Hello Alex, > > I was reading through this thread, and I was curious about what methods > you use to handle fractions of a dollar and/or fractions of a penny if > you are always using integers. Do you only use a decimal for printing? > do you adjust all interest rates, etc...then as well? How about when > interest calculations result in fractions of pennies, how do you handle > it then? Basically, I can't see how it could be done with just integers > alone? Depends on what you're working with. I don't think banks can get away with using pennies. But a storefront can usually do so since they don't charge fractions of pennies and don't offer interest :) Cheers, Rob. -- http://www.interjinn.com Application and Templating Framework for PHP

« previous php.general (#276788) next »