2

For tracking shares in GnuCash, the maximum number of decimal places allowed seems to be 8 (100 millionth) but I'm dealing with fractions with 9 decimal places. Any extra decimals after 8 get truncated. Is there a workaround for this?

I'm running GnuCash 2.6.1 on Linux Mint.

3
  • 1
    What in the world needs that level of precision? Dec 21, 2016 at 3:05
  • A difference of one 100-millionth of a share would be worth only $1 even if an individual share were worth $100 million. Even Berkshire Hathaway only costs around $250,000 per share, so one 100-millionth would be worth less than half a penny. I'm skeptical that there's any practical need for that level of precision.
    – BrenBarn
    Dec 21, 2016 at 3:14
  • The account in question is a target date fund in a 401k. Statements do show that contributions are buying fractions of shares to 9 decimal places. Currently, inputting this into GnuCash I'm rounding off the last digit (e.g. 14.59854015 shares) but I see a discrepancy of 3.98 shares in the balance over time which I think is caused by the rounding. I do think it's excessive but precision to the last decimal place is necessary to keep the balance accurate.
    – Elfalem
    Dec 22, 2016 at 4:17

1 Answer 1

2

As BrenBarn stated, tracking fractional transactions beyond 8 decimal places makes no sense in the context of standard stock and mutual fund transactions. This is because even for the most expensive equities, those fractional shares would still not be worth whole cent amounts, even for account balances in the hundreds of thousands of dollars.

One important thing to remember is that when dealing with equities the total cost, number of shares, and share price are all 3 components of the same value. Thus if you take 2 of those values, you can always calculate the third: (price * shares = cost, cost / price = shares, etc). What you're seeing in your account (9 decimal places) is probably the result of dividing uneven values (such as $9.37 invested in a commodity which trades for $235.11, results in 0.03985368550891072264046616477394 shares). Most brokerages will round this value off somewhere, yours just happens to include more decimal places than your financial software allows.

Since your brokerage is the one who has the definitive total for your account balance, the only real solution is to round up or down, whichever keeps your total balance in the software in line with the balance shown online.

1
  • Thanks. I checked the worst error that could be caused by persistent rounding and it was many orders of magnitude smaller than the discrepancy I was seeing. After some detective work, reading fine prints, and crunching numbers, it turns out the administrative/service fee is hidden and not reported on statements. After accounting for that fee, the discrepancy is gone. So nothing to do with rounding.
    – Elfalem
    Jan 12, 2017 at 6:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .