GnuCash
Contact   Instructions
Bug 743999 - Deleting a digit from an existing number greater than four digits in length generates an error message
Summary: Deleting a digit from an existing number greater than four digits in length g...
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Register (show other bugs)
Version: 4.4
Hardware: Other All
: Normal normal
Target Milestone: ---
Assignee: ui
QA Contact: ui
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-04 11:24 EST by Robert Nargang
Modified: 2021-06-18 14:56 EDT (History)
4 users (show)

See Also:


Attachments

Description Robert Nargang 2015-02-04 11:24:57 EST
When inputting a transaction, if the user inputs a number greater than four digits (not including the decimal) and advances to the next field, GnuCash will autoformat the number to the preset formatting. If you make a typing error and go back and delete one of the digits changing the total number of digits/numerals, the amount will change into an invalidly formatted amount and create an error message.

For instance, I accidentally typed "15000" when I meant to type "1500". I didn't catch the mistake immediately, pressed the "tab" key to advance to the next field, and GnuCash automatically formatted the amount to "15,000.00". Upon realizing my error, I used the mouse to position the cursor at one of the extra zeros thinking I could delete it, fixing the amount, and move on. Instead, the program issued an error message. ("An error occurred while processing 15,00.00.") I had to also delete the comma formatting creating the basic "1500" number again.

I understand the error appears to be from the number now being formatted incorrectly, but it seems as if the program should be "smarter" than that. In a spreadsheet, the number is separate from the formatting. I can change an existing number and the software will reformat it displaying it correctly. I was surprised that GnuCash didn't do that. Maybe it's something not easily changed, but I wanted to bring it to the attention of the developers.
Comment 1 Mike Evans 2021-03-13 09:52:25 EST
Thank for you bug report and apologies that no one got back to sooner.  I just confirmed thin on Linux too (in 2021) so I'm changing Hardware to All and upping the version.
Adding a digit has the same effect.
Comment 2 John Ralls 2021-03-13 15:26:46 EST
I tried to fix this in response to bug 797889,
https://github.com/Gnucash/gnucash/commit/c4d9ca7bc6468f5b7614e2d12a304b2c2332d407#diff-149f569e8a95e454650d3cad812b8d55680ea961ec284a1765469d79fed91a83
but that provoked bug 797959 so I reverted it in 
https://github.com/Gnucash/gnucash/commit/c8b725d48a2576d8543663cdb49a9cb37d0a9daf#diff-149f569e8a95e454650d3cad812b8d55680ea961ec284a1765469d79fed91a83

I suspect the right place to fix this is in libgnucash/app-utils/calculation/expression_parser.c somewhere.
Comment 3 John Ralls 2021-06-18 14:56:02 EDT
The change was actually to xaccParseAmountExtended in libgnucash/app-utils/gnc-ui-utils.c.

Fix will be in GnuCash 4.6.

Note You need to log in before you can comment on or make changes to this bug.