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 305034 - switching the point format resets the displayed value to zero
switching the point format resets the displayed value to zero
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
5.6.x
Other All
: Normal normal
: ---
Assigned To: Sami Pietilä
Sami Pietilä
Depends on:
Blocks:
 
 
Reported: 2005-05-21 20:05 UTC by Christian Krause
Modified: 2005-05-27 05:00 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
patch that fixes the bug (1.11 KB, patch)
2005-05-22 09:31 UTC, Christian Krause
none Details | Review

Description Christian Krause 2005-05-21 20:05:45 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:
Comment 1 Christian Krause 2005-05-22 09:31:22 UTC
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. ;-)
Comment 2 Rich Burridge 2005-05-23 14:16:25 UTC
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.
Comment 3 Sami Pietilä 2005-05-26 21:01:54 UTC
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.
Comment 4 Rich Burridge 2005-05-26 21:35:34 UTC
Changes checked into CVS HEAD. Version number in
configure.in bumped to 5.6.16.
Comment 5 Sami Pietilä 2005-05-27 05:00:38 UTC
Thanks!