Lately, I've been involved with discussions surrounding the representation of commodity values for the GnuCash project.
The "problem" is thus:
People want to track various different commodities, including money, in multiple currencies.
I, for instance,
have bank accounts in both the United States and Canada, in the relevant currencies.
- People want to track
stock portfolios, that introduce all the varying sets of stock commodities.
The PROBLEM is that these are
all denominated in different terms. Dollar amounts usually are decimal fractions in units of 1/100 dollars.
Stocks often are represented as integer quantities, although sometimes you can wind up with fractional shares.
Mutual fund unit quantities tend to be represented as decimal fractions in units of 1/1000 or 1/10000 shares. In
some cases, things are denominated as fractions based on 16ths or 64ths.
That briefly characterizes the
But then there is the "price" issue. You join together two commodities, and have some
translation ratio, say for translating US dollars to CDN dollars, or for translating RHAT stock to $USD.
There has been a great "flame war" over this; there is some desire to have a "grand, unified quantity data
structure," although that seems to me to be a bit unrealistic, as the denominator is always based on the nature of
the commodity, which isn't part of the quantity.
Once the roar settles down, the "Grand Unified Data
Structure For Prices" is likely to fall out of this in a reasonably natural way.
Note that floating point
values are not well suited to this, as FP isn't TOTALLY stable...