[GNC] problem setting the price of a share

John Ralls jralls at ceridwen.us
Sat Sep 15 10:45:55 EDT 2018


The reason David’s advice is correct is that decimal numbers on computers are represented as binaries and are fundamentally inaccurate: it is not possible to exactly represent 0.1 in binary, just as it’s impossible to exactly represent 1/3 as a decimal fraction.You avoid the representation problem by letting GnuCash compute the price for you. 

If you really insist on entering the price, enter it as a rational number... but it must be exactly correct or GnuCash will change it, and that means exactly correct after rounding the value to the smallest currency unit (1/100 in most currencies). E.g., you can’t buy 100 shares at $1.23456 because $123.456 is nonsensical: It’s either $123.45 or $123.46.

Regards,
John Ralls


> On Sep 15, 2018, at 7:25 AM, David Carlson <david.carlson.417 at gmail.com> wrote:
> 
> As I stated in my reply, enter the number of shares and total amount,  Skip
> the price, let GnuCash take care of that.
> 
> David C
> 
> On Sat, Sep 15, 2018 at 9:21 AM Christian Pinedo Zamalloa <
> chr.pinedo at gmail.com> wrote:
> 
>> Hi David,
>> 
>> I also agree with you that the fractional format is more difficult to read
>> than decimal and I also hope to return to decimal format or at least to be
>> able to choose between decimal or fractional format.
>> 
>> Regarding my problem with price, I insert the number of shares, the prices
>> (in decimal format) and press enter. The decimal formal is converted to
>> fractional format, but fractional number is not the same that I inserted
>> before. :-(
>> 
>> Any idea?
>> 
>> --
>> Christian Pinedo Zamalloa (zako)
>> Sent from my mobile device, please excuse brevity or typos
>> 
>> El sáb., 15 sept. 2018 14:49, David Carlson <david.carlson.417 at gmail.com>
>> escribió:
>> 
>>> Christian Pinedo Zamalloa
>>> 
>>> You have discovered that it is impossible to have all three values
>>> shares, price and total exactly as reported by your broker because he
>>> usually has to round off one of the numbers.  The solution is to let
>>> GnuCash set the price after you enter the number of shares and the total
>>> amount.  Actually, GnuCash is closer to being correct than your broker is.
>>> 
>>> You have also discovered that in release 3.3 GnuCash shows the number of
>>> shares in fractional format, which has the technical advantage of being
>>> very accurate, if very hard to read.  I believe that in the future GnuCash
>>> may be changed back to show the number of shares in decimal format to be
>>> easier to read, if less accurate.
>>> 
>>> David C
>>> 
>>> 
>>> 
>>> On Sat, Sep 15, 2018 at 4:16 AM Christian Pinedo Zamalloa <
>>> chr.pinedo at gmail.com> wrote:
>>> 
>>>> Hello,
>>>> 
>>>> I have problems to set the correct price of a share that I am selling.
>>>> 
>>>> I try to put the value "128,181208053691" which is automatically
>>>> converted
>>>> by GnuCash when i push enter key to "128 + 64/377" whose real value is
>>>> "128,169761". Furthermore, I checked if I insert value "1", it is
>>>> automatically converted by GnuCash to value "1+3/377" (1,007958).
>>>> 
>>>> I don't know how to solve this mesh. Am I doing something wrong?
>>>> 
>>>> --
>>>> zako
>>>> _______________________________________________
>>>> 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
>>>> If you are using Nabble or Gmane, please see
>>>> https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
>>>> -----
>>>> Please remember to CC this list on all your replies.
>>>> You can do this by using Reply-To-List or Reply-All.
>>>> 
>>> 
> _______________________________________________
> 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
> If you are using Nabble or Gmane, please see https://wiki.gnucash.org/wiki/Mailing_Lists for more information.
> -----
> 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