Created attachment 374092 [details] see pdf properties->subject for description of each image You may recall me from such bugs as "Bug 797982 - exchange rates' decimal places (edit)" that I logged last October and the amazing gnucash team responded brilliantly quickly to fix. I am still totally impressed. I've just pulled and built 4.6 from github and went to add an exchange rate in the price database. I wanted the AUD/USD rate to be 1.3173, so did my usual click "Add", Security: USD, Currency: AUD, Date 28/06/21; Type: Last; Price: 1.3173; OK. However, unlike all my earlier exchange rates, this is displaying as 1.32. If I edit, same result. I exited and re-entered gnucash, shows 1.32 in Price Database, but Price Editor shows 1.3200; changing to 1.3173 again displays as 1.32. I retried adding a new entry with the same date (asked if I wanted to replace: yes) and editing gave same result. HOWEVER, I had been clicking "apply" and "OK" to accept the new exchange rate. When I instead hit "enter" on the keyboard, the 1.3173 was finally accepted. Weird, huh? Subsequent accept/OK changes get truncated to 2 decimal places; "enter" changes get 4 decimal places. Do you think you could take a squiz? Thanks. --- config details: $ gnucash --version GnuCash 4.6 development version Build ID: git 4.6+(2021-06-26) DISTRIB_DESCRIPTION="Ubuntu 20.04.2 LTS" VERSION="20.04.2 LTS (Focal Fossa)" $ dpkg -l '*sqlite*' | grep ^.i ii libdbd-sqlite3:amd64 0.9.0-8ubuntu1 amd64 SQLite3 database driver for libdbi ii libmono-sqlite4.0-cil 6.8.0.105+dfsg-2 all Mono Sqlite library (for CLI 4.0) ii libqt5sql5-sqlite:amd64 5.12.8+dfsg-0ubuntu1 amd64 Qt 5 SQLite 3 database driver ii libsqlite3-0:amd64 3.31.1-4ubuntu0.2 amd64 SQLite 3 shared library ii libsqlite3-dev:amd64 3.31.1-4ubuntu0.2 amd64 SQLite 3 development files
GnuCash Preferences -> Number, Date, Time -> Force Prices to display as decimals: Tick Automatic decimal point: unticked Decimal places: 2
Confirmed. Bob, reverting 8f063159 fixes this. Prices shouldn't be rounded except for display and then to 1/100 * the currency's SCU; in this case 4 digits, not 2.
Created attachment 374098 [details] Fix entering prices Sorry about this, did not occur to me the prices have more decimal places. I think this change fixes it by setting the fraction of the amount edit to 0 so will not round. The reason for the difference in behavior was that by pressing the enter key, the amount edit was being validated, (which set internal flag indicating so), before I had made the changes to print_info. Then the 'OK' button call back was triggered which eventually does the copy of values to the price database and it here that the value is checked again and as it has already passed the earlier value is retrieved and used. I also noticed that the price editor was being populated with the rounded value of the price, the same on version 4.5, so have changed that to display the actual price which also fixes the observation above. If OK will push this.
Forgot to mention, I think made the same mistake on the price value in the stock split assistant so can make a similar change there.
*** Bug 798223 has been marked as a duplicate of this bug. ***
I have pushed a fix for this and will be in the next nightly and version 4.7 Will leave this open so it can easily be found for duplicates till next release. Sorry for the error.
I cherry-picked Bob's commit 8d6675442 "Bug 798219 - Price dialog prices truncated" on top of 4.6, rebuilt gnucash and can confirm this fixes the bug. Many thanks, Bob and team, yet another sterling (or even AUD/USD) effort. It is much appreciated.
*** Bug 798240 has been marked as a duplicate of this bug. ***
*** Bug 798246 has been marked as a duplicate of this bug. ***
*** Bug 798247 has been marked as a duplicate of this bug. ***