[GNC] Rounding issues with Stock
John Ralls
jralls at ceridwen.us
Mon Aug 26 23:01:27 EDT 2024
The issue here is rounding. GnuCash enforces a minimum fraction on all commodities. For most currencies that fraction is 1/100; a few, e.g. Japanese Yen, it’s 1/1. Most mutual funds have a minimum fraction of 1/1000, most stocks have fractions of 1/—though DRIP accounts will pretend to have fractional shares for accumulation purposes.
The remaining variable, Price, has no minimum fraction and has a resolution of 1/9223372036854775808. If you enter the number of shares and the amount of currency (GnuCash designates that the value) and let GnuCash calculate the price there’s no need for rounding anything: The price will be exact. If you enter the price in any normal way and leave it to GnuCash to calculate the shares or the value then you have a good chance of forcing GnuCash to round the result because the computed amount or value will have a fraction whose denominator is smaller than the minimum for the commodity.
Regards,
John Ralls
> On Aug 26, 2024, at 17:55, Derek Atkins <derek at ihtfp.com> wrote:
>
> GnuCash only maintains the number of shares and the total value. The
> per-share price is /always/ computed.
>
> When you are entering a transaction, GnuCash allows you to enter any two
> values and it will compute the third -- however it still only stores #
> shares and total value.
>
> IANAA, but IMHO you should worry about the #shares and total value and
> don't worry about the rounding difference in the per-share price.
>
> NB: GnuCash will not keep track of the $0.0036
>
> -derek
>
> On Mon, August 26, 2024 8:38 pm, NS wrote:
>> First, let me tell you I am a recent user of GNUCash, and by no means I am
>> a bookkeeper or know a lot about accounting.
>> I am using the tool to keep control of some stock I own.
>>
>> Here is my issue.
>> I have a DRIP on the stock. My broker says the reinvested price of each
>> share was $26.4884, and they bought 4 shares for a total value of
>> $105.9536.
>>
>> Now, I cannot enter four decimals in the buy (I do not know if it is a
>> setting), even though the price handles them.
>> When I recorded the transaction in GNUCash y entered 4 shares and a buy of
>> $105.95 and a price of $26.4875 was calculated.
>>
>> If I enter 4 shares and the price of $26.4884, it recalculates it to
>> $26.4875.
>>
>> How do I solve this? I want to keep track of the correct numbers.
>>
>> Thanks for your help.
>> _______________________________________________
>> gnucash-user mailing list
>> gnucash-user at gnucash.org
>> To update your subscription preferences or to unsubscribe:
>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>> -----
>> Please remember to CC this list on all your replies.
>> You can do this by using Reply-To-List or Reply-All.
>>
>
>
> --
> Derek Atkins 617-623-3745
> derek at ihtfp.com www.ihtfp.com
> Computer and Internet Security Consultant
>
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.
More information about the gnucash-user
mailing list