Rounding in the price db.

John Ralls jralls at ceridwen.us
Tue Sep 22 12:25:43 EDT 2015


> On Sep 22, 2015, at 6:59 AM, David Carlson <david.carlson.417 at gmail.com> wrote:
> 
> Testing git rev 766cf48+ on 2015-09-18, I have a report using "Nearest in Time" price reference.  There is an F::Q price for January 30 2015 in the db and a user:split-register price has now appeared for February 1 that is slightly off because the transaction that generated it was for 2.203 shares at $10.16 totalling $22.38.  That translates to 10.158874 per share in GnuCash.  Now my January 31 2015 report is off by $0.67 for that security and also for a couple of other securities with the same issue.  Last January the report was correct.  I know that there has been discussion about having a report option that would not select following-day prices and here is the example of why I think it is needed.  This year is bad that way, February May and October present the same situation.  Going back and adding a lot of bogus weekend prices just to get good reports would be a pain.

I agree. It’s https://bugzilla.gnome.org/show_bug.cgi?id=743753, BTW. I haven’t looked into it but I think the code in question is in the report module, which is beyond the scope of this particular set of changes. It’s also been the behavior for all of 2.6.x.

> 
> By the way, when I went into the price db to add a price for January 31, I noticed that the February 1 price was labelled as unknown type and no source was shown in the edit window, just in the list.  I thought the source used to be shown in the edit window as well.  That is not a real issue, but when I edited the February 1 price to 10.16 the source was not changed to user: price-editor as it should have been.

No, the edit dialog hasn’t ever shown the source. I did notice that using the price editor doesn’t change the source, also historical behavior. It hasn’t mattered in the past, of course: Source and type were just info for the user. Now that it’s more important I suppose that the edit price dialog should accurately reflect the source.

Type is another issue. The original idea was to identify *quotes* as Bid, Ask, Last, and NAV (meaning respectively the price the market-maker will pay for your shares, the price at which he’s selling shares, the price of the last trade, and the Net Asset Value calculated by the mutual fund company the previous afternoon and used for all trades on the day). The edit price dialog allows the user to select among those; Finance::Quote may report Bid, Ask, and Last but the GnuCash parser always captures Last if it’s available. F::Q unfortunately doesn’t designate NAV, reporting it only as Last — and I think you noticed at one point that it’s for the wrong day. I think I should add a type “actual” for prices generated by transactions, perhaps replacing “unknown”. Since it’s there only for user info I left it alone.

>  
> Also, I happened to be sitting on February 1 when I selected Add new price.  I put the focus on the date in the editor window and pressed the minus key the date changed to January 30.  Pressing the plus key then correctly advanced the date to January 31.

Odd, but not related to calculating prices.
> I hope those are the only issues.

So do I.

Regards,
John Ralls




More information about the gnucash-devel mailing list