GNOME Bugzilla – Bug 305034
switching the point format resets the displayed value to zero
Last modified: 2005-05-27 05:00:38 UTC
Please describe the problem: When switching the format e.g. from ENG to FIX the displayed value switches to zero (in the corresponding format, so e.g. 0.0 or 0e+0, ...). When I switch then the numerical base to another one the correct number is displayed (in the corred format) again. Steps to reproduce: 1. start gcalctool 2. set it to scientific mode 3. type in a number (e.g. 5) 4. switch the format, e.g. from Fix to Eng Actual results: displayed number (5) switches to 0e+0 Expected results: 5e+0 should be displayed Does this happen every time? yes Other information:
Created attachment 46738 [details] [review] patch that fixes the bug I've created a patch that fixes the problem. I just used the same code for updating the display in do_numtype as it was used in do_base. I'm not really sure whether this is the right way, but it works at least for me. It fixes additional the behaviour of switching num_types when a number is entered but not "calculated". When entering e.g. a number and do not press <Enter> or <=> and switching bases, this new number is displayed with different bases. Switching num_format behaves now accordingly. I've seen that this pieace of code is used in several functions, so there is a lot of redundancy which could be unified somewhen. ;-)
Reassigning to Sami as this only fails in "Use Arithmetic Precedence" mode. Sami, could you please checkout the patch that Christian has attached (thanks!), and if you are okay with it, commit it to CVS HEAD.
The patch is ok. Thanks! Rich, can you apply the patch and commit the changes? I am having a problem with the CVS server. It keeps saying "cvs server: Up-to-date check failed for `functions.c'" even when I have a fresh tree with the patch and I try to commit the changes.
Changes checked into CVS HEAD. Version number in configure.in bumped to 5.6.16.
Thanks!