From: Carl Youngblood Date: 2004-10-31T03:46:42+09:00 Subject: Re: Money Class (was Re: Rounding error, (100.0 * 9.95).to_i == 994) Come to think of it, do all currencies even have "cents"? I know of some countries where the currency is so devalued that nobody uses fractionary amounts. On Sat, 30 Oct 2004 22:46:59 +0900, Francis Hwang wrote: > > On Oct 30, 2004, at 9:05 AM, Brian Schr�der wrote: > > > Why not just use integer valued cent-counts? > > Sometimes that's not sufficient. If you're an organization that has to > deal with quantities and amounts priced in multiple currencies, you > have to store both the number and the currency itself. 5 Euros, 10 > dollars, 42000 Korean won, etc. Then if you are adding or comparing > them to one another you have to figure out how to sensibly model that. > What's 5 Euros plus 10 dollars? Does it matter that the answer to that > question changes over time, as exchange rates are constantly > fluctuating? > > It's a pretty interesting little domain. Martin Fowler devotes a few > pages to it in Analysis Patterns.