Mutual fund prices precision

AC gnucash at acarver.net
Mon Aug 3 19:42:08 EDT 2015


On 2015-08-03 16:15, Mike or Penny Novack wrote:
> "No, I'm entering precisely what is on the statement for the number of
> shares so both should agree."
> 
>       Incorrect assumption. You have no good reason to expect them to
> agree.

No, it's a correct assumption.  If I type a number in I expect that
number to stay the same.  If I type 1.234 which came from a piece of
paper, then both GC and my piece of paper should say 1.234 no more no less.

> 
> " I'll just live with the price weirdness unless I can somehow get the
> internal totals to have more significant figures."
> 
>      That is not the problem. It isn't that not enough significant
> figures are used in the calculations. It is that the calculations aren't
> being done in the same order of operations with the same degree of
> rounding at all the same places.
> 
>      rounded(a) + rounded(b) does not (necessarily) equal rounded(a+b)

That is true except that the total price in GC is artificially reduced
to two decimals which is inducing rounding errors on its own.  The funds
do not trade with precision higher than three decimal places in the
number of shares or price per share (verified with a broker).  The final
rounding is in the final price.  So to get the shares and final price to
agree I have to let GC and the statement disagree on the price per share.

I just checked by making a fake account set.  No shares yet and I set
the smallest fraction in the parent account to 1/10000 (instead of
commodity default of 1/100 for USD) and the fund account uses the same
1/10000 fraction.  I added a transaction for 2.345 shares at 4.8 per
share and let GC compute the price.  Since the parent is set for
1/100000 I expected to see that reflected in the total price which
should compute to 11.256 (and well within the range of a 1/100000
fraction).  Instead it computed 11.26 and then, as Derek pointed out, it
back computes the price per share and made it 4.80171 instead of the
original 4.80.

Interestingly, in the main accounts list, the currency shown in the
parent account properly displays all five decimal places but it's
rounded off.  Thebalance column reads "11.26000" instead of what I
expected.

Since I have no plans of using a GC report when filing taxes the price
per share doesn't have to be perfect otherwise my basis numbers would be
off.  II'll just live with the oddity but it seems it ignores the
fraction setting and is rounding off to the commodity no matter what.  I
suppose I could make a new USD which a much smaller fraction but that I
suspect invites even more weirdness.



More information about the gnucash-user mailing list