After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 341362 - Price Editor: Price is displayed as fraction instead of decimal
Price Editor: Price is displayed as fraction instead of decimal
Status: VERIFIED FIXED
Product: GnuCash
Classification: Other
Component: User Interface General
git-master
Other All
: Normal normal
: ---
Assigned To: Charles Day
Chris Shoemaker
: 496593 (view as bug list)
Depends on:
Blocks: backport
 
 
Reported: 2006-05-11 02:53 UTC by dvherman
Modified: 2018-06-29 21:03 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Screen shot of issue (112.86 KB, image/png)
2006-05-11 02:56 UTC, dvherman
Details
GnuCash example data file (8.03 KB, application/octet-stream)
2006-05-11 02:57 UTC, dvherman
Details
price editor panel (16.13 KB, image/jpeg)
2007-09-21 22:11 UTC, David Wilson
Details

Description dvherman 2006-05-11 02:53:54 UTC
Please describe the problem:
While working on an example of stock mergers for the Concept Guide I
encountered the attached display.  The stock price in fractions caught
my attention.  The price was entered via the "Stock split druid".

I'm working off of today's svn build (13953), Fedora 5 (updated May 8),
x86_64.

I'll attach a screen shot of the issue and the data file.

Steps to reproduce:
1. Create a Assets:investment:stock account
2. Purchase Stock
3. Invoke Split druid and enter stock price on Detail screen
4. Run Adv. Portfolio report - price should be displayed with fraction
5. Price Edit stock also shows in fraction.


Actual results:
Stock price displays a Int and fraction

Expected results:
price as $x.xx00

Does this happen every time?
Yes

Other information:
See attachments
Comment 1 dvherman 2006-05-11 02:56:19 UTC
Created attachment 65211 [details]
Screen shot of issue

Next attachment will be data file
Comment 2 dvherman 2006-05-11 02:57:50 UTC
Created attachment 65212 [details]
GnuCash example data file
Comment 3 lexual 2006-08-03 21:31:47 UTC
appears related to bug:348364
Comment 4 Christian Stimming 2006-10-18 11:27:21 UTC
As bug#348364 comment#1 says: We should just use the correct gnc_numeric -> string printing function.
Comment 5 David Wilson 2007-09-21 22:07:03 UTC
I have the same problem, one of my stocks in my Investment Portfolio report has for some time displayed as a fraction i.e. "$0 + 43 /  500". Only this stock has the problem.

The problem seems not so much as the report code but the price fetching code for the fraction is shown in the Price Editor and the report is showing the same thing. I will attach a screen print of the price editor panel. 

I have checked the yahooquote - it fetches the price correctly -

/test$ yahooquote lmp.ax
LMP.AX  L&M PETROL FPO NZ       0.086   9/21/2007       ASX


Comment 6 David Wilson 2007-09-21 22:11:16 UTC
Created attachment 95991 [details]
price editor panel
Comment 7 Charles Day 2008-07-24 19:54:43 UTC
Confirmed. I can still reproduce this with r1740. It only happens for certain split amounts. For example, with a current balance of 10 shares, do a stock split and enter 40 for "Shares" and 3.22 for "New Price".
Comment 8 Charles Day 2008-07-24 19:55:58 UTC
Re: comment 7 -- Oops, that was r17402.
Comment 9 Charles Day 2008-07-25 00:25:58 UTC
Fix committed as r17407. Requesting backport for 2.2.
Comment 10 Charles Day 2008-07-25 02:29:40 UTC
Please note that this fix will not repair prices that have already been created via the stock split druid. However, future stock splits will create prices correctly.

I assume there are very few fractional prices already in your data file. To fix them, edit each price via the Price Editor and replace the fraction. (For example, change "3 + 11 / 50" to "3.22".)
Comment 11 Charles Day 2008-07-25 02:37:25 UTC
*** Bug 496593 has been marked as a duplicate of this bug. ***
Comment 12 Charles Day 2008-07-27 20:00:14 UTC
I have made some additional changes to fix this bug without doing any rounding.

Please backport r17407, r17421 and r17429 for this bug. (Note: part of the purpose of r17429 is to reverse r17407.)
Comment 13 David Wilson 2008-07-28 11:22:43 UTC
My problem just disappeared seemingly of its own accord some months ago, so I can not test code changes. It has not reappeared since. Sorry to be of little help here. 

Thanks for looking into the problem. Gnucash is a great application.

David
 
Comment 14 Charles Day 2008-07-28 15:55:53 UTC
Re comment 10: The updated version of the fix addresses old quotes created by the stock split druid. So there is no need to go back and reenter them.

Re comment 13: The updated version of the fix also addresses display of downloaded quotes, both old and new. Glad you are not experiencing the problem any more, but maybe it is because some rounding was added recently. Since we don't need to round prices any more, I'll take a look and get rid it if there turns out to be any.
Comment 15 Charles Day 2008-07-28 16:41:47 UTC
Re comment 13: I don't think your fractional quote could have been downloaded, as the quote module cannot create quotes with a denominator of 500. Downloaded quotes are always decimal, so they would not display as fractions.

Perhaps you are not seeing the fractional price on your reports any more because you have entered or downloaded a newer price. Or maybe you corrected the fractional price by hand and forgot about it?
Comment 16 David Wilson 2008-07-29 03:05:18 UTC
RE comment 15: Certainly the stock prices in the report are new updated stock prices. However I still have some of the fractional prices recorded and visible in the prices editor for example "0 + 19 / 25" for 19 May 2008 for the LMP.AX stock.

I don't have full record of the fraction prices because I fixed many of them up in the price editor so that the reports would display better. But the most recent one I can find is 19 May 2008.  I am not sure when I upgraded to 2.2.5 so it could have 2.2.4 or 5.

Comment 17 Charles Day 2008-07-29 04:19:16 UTC
Re comment 16: OK. I don't think there's anything else that needs to be done. This fix will prevent fractional display of any price that can be turned into a decimal number, regardless of source. For example, "0 + 19 / 25" is now automatically shown as 0.76.

So you should be all set once this fix gets released (probably 2.2.7).
Comment 18 Andreas Köhler 2008-09-15 14:44:54 UTC
(In reply to comment #12)
> Please backport r17407, r17421 and r17429 for this bug. (Note: part of the
> purpose of r17429 is to reverse r17407.)

r17421 applied to branches/2.2 as part of r17511.
r17407 and r17429 applied to branches/2.2 as r17512 for inclusion in GnuCash 2.2.7.
Thanks a lot!
Comment 19 John Ralls 2018-06-29 21:03:49 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=341362. Please update any external references or bookmarks.