Proposal for modifying gnucash to use exact quantities

Jon Trowbridge trow@emccta.com
Fri, 28 Jul 2000 11:46:49 -0500


On Fri, Jul 28, 2000 at 12:24:53PM -0500, Richard Wackerbarth wrote:
> All you need to do that is switch to some form of integer amounts of SCU.
> and associate a formatting routine to display the result in a different unit.

Let's assume for the moment that Bill's proposal is fundamentally
wrong for the task at hand, but that it gets implemented anyway.

One thing that will come out of this is that all of the "financial
math" in GnuCash will be changed from regular C-math (a = b+c) to
Bill's-API-math (a = gnc_sum(b,c), or whatever).

In theory, this means that whether or not rationals or integer amounts
of SCU are used becomes an implementation detail, that would hopefully
be hidden behind the API.  If this is the case, it should be possible
to switch between the two approaches once GnuCash has been
Bill's-API-ified.

Richard: Is this a correct assumption, or is the API somehow too
closely coupled to rational representations?  Ignoring for a moment
the question of whether or not the API is overkill for
integer-amounts-of-SCU, would that API be able to act as a front-end
for your proposed method if necessary?  Or would the API need to be
changed in some way?  Or are the two approaches so fundamentally
orthogonal that they couldn't be dealt with by a common API?

I feel quite unqualified to have an opinion these questions, since I
don't know jack about accounting; I'm just interested in having a
standard library for conveniently representing securities prices,
which is a problem where rounding and such are much less important.
However, the vehement disagreement on the list seems to be blocking
(or at casting a cloud over) progress on an issue that everyone seems
to agree is important: rounding error in GnuCash.  If a common API
could be agreed on, at least conversion of the math in GnuCash could
go forward in a way that everyone would be confident about, and debate
about implementation details could be deferred until later...

-JT

-- 
GNU/Linux: Free your mind and your OS will follow.