> Prices are handled differently from amounts.
> 
> The price is multiplied by the quantity and that result is adjusted to the
> "integral" amount of exchange.
> At one time the US used "mils" ($0.001). However, clerks worked for $1 per day
> or less. With inflation, the smallest exchange is now the penny ($0.01) and
> commerce is conducted in those units.
...
> Each currency has its own "primitive" amount and all transactions are 
> conducted in terms of that unit. Prices are often expressed to a higher 
> precision or as a rational fraction of that unit.

This suggests that we should be storing integers that indicate
how many of the primitive amount are to be used.  For US$ this would
me an exact count of pennies.

The range of integers must be greater than 32-bits, because
that would limit amounts to about #40,000,000.00.
So the obvious type is int64, which is not quaranteed to be present
by either C or glib, but often is; the less obvious type is
double, provided we make sure we only store integer values in the double
variables (i.e., frequent rounding to integral).  Thus, for display purposes,
we may have to know the primitive amount for each currency as well
as the format to be used.

-- hendrik.

I've always been doubtful about the use of floating point by gnucash.


--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]


Reply via email to