# Proposal for modifying gnucash to use exact quantities

**Jason Rennie**
jrennie@ai.mit.edu

*Sun, 30 Jul 2000 14:24:40 -0400*

rkw@dataplex.net said:
>* I am not aware that anyone has suggested that there be a "universal"
*>* denominator.
*
The talk of having everything represented in "ergs" was be an example
of using a "universal" denominator.
rkw@dataplex.net said:
>* Therefore it is unnecessary to carry that denominator with the
*>* individual values. It can be retrieved from the description of the
*>* units in those very few places where it actually gets used.
*
Yup. Makes sense. One denominator per currency should be plenty.
rkw@dataplex.net said:
>* Similar analysis of the "exchange" function will show that you only
*>* need the numerators to do a currency conversion.
*
No. You do need the denominator. Let's say that I'm converting 1 USD to
Italian Lira (for example). The denominator for USD is 100. The
denominator for Lira is 1. The exchange rate is 1000 Lira for 1 USD.
The 1 USD will be internally represented as 100. If I use your equation:
rkw@dataplex.net said:
>* integer N2 (of currency C2) = convert_to_integer (N1 * C2 / C1)
*
I get N2 = 100 * (1000/1) = 100,000. Too many Lira! The real equation
is:
N2 = (N1/D1) * (rate) * D2
where N1 is the numerator for the first currency, D1 is the denominator
for the first currency, "rate" is the exchange rate, N2 is the numerator for
the second currency and N2 is the numerator for the second currency. In
your USD/Mexican Pesos example, it just so happened that D1=D2=100 so you
could safely throw out the denominator terms.
rkw@dataplex.net said:
>* For bookkeeping, the round_to_integer conversion should be adequate
*>* because this calculation is only used to express an estimate of the
*>* value. Any transaction postings will be modified to reflect the
*>* actual amounts involved.
*
Yup. Makes good sense to me.
Jason D Rennie www.ai.mit.edu/~jrennie/
MIT: (617) 253-5339 jrennie@ai.mit.edu
MITRE: (781) 271-7249 jrennie@mitre.org