Re: fractional cents
"A. Pagaltzis" <[email protected]>
| Newsgroups | gmane.comp.lang.perl.fun |
|---|---|
| Message-ID | <20040424144309.GB805@klangraum> |
* Keith C. Ivey <[email protected]> [2004-04-22 14:48]: > Math won't work, because floats aren't exact. Actually, that is a point I meant to make somewhere in this thread. When you're dealing with money, it's better to use cents (or tenths or hundredths of cents) as a unit, rather than dollars. You can then use integer math. This gets you around all the problems with a base-2 representation of base-10 fractions, something you don't want to have to deal with when money is on the line.. -- Regards, Aristotle "If you can't laugh at yourself, you don't take life seriously enough."