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 108226 - More options for accuracy
More options for accuracy
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Rich Burridge
Rich Burridge
: 104904 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2003-03-12 18:25 UTC by martin H.
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to implement required functionality. (17.23 KB, text/plain)
2003-03-17 23:23 UTC, Rich Burridge
Details
Provide required functionality (take 2). (18.33 KB, text/plain)
2003-03-18 12:05 UTC, Rich Burridge
Details
Patch file to adjust to "Show Trailing Zeroes" style. (14.97 KB, text/plain)
2003-03-24 20:03 UTC, Rich Burridge
Details

Description martin H. 2003-03-12 18:25:03 UTC
I think the should be more options in the accuricy dropdown. In all modes I
think a option should be added that doesn't display trailing zeros after
the decimal point (my paocket calculator call this "float").

In Scientific we should have a an option that always forces exponential
output. And one that forces engineering(beeing exponential but with
exponets dividable through 3) output.

Of course the Scientific and the engineering mode have to revert to
something different if the user leaves Scientific mode (assuming they are
only choosable in Scientific mode).

Additionaly it would be nice if the current setting would be displayed
somewhere, in the current state the user can only guess.
Comment 1 Rich Burridge 2003-03-12 19:14:06 UTC
> I think the should be more options in the accuricy dropdown. 
> In all modes I think a option should be added that doesn't 
> display trailing zeros after the decimal point (my paocket
> calculator call this "float").

Does setting accuracy (Acc) to "0 radix places" give you want 
you want here? If not, could you explain it in more detail please?

> In Scientific we should have a an option that always forces
> exponential output. And one that forces engineering(beeing
> exponential but with exponets dividable through 3) output.

These are there. The "Eng" and "Sci" radio buttons in the
mode panel above the main calculator buttons (in Scientific mode).

> Of course the Scientific and the engineering mode have to 
> revert to something different if the user leaves Scientific
> mode (assuming they are only choosable in Scientific mode).

I've tagged that as a followon comment to the other bug you
raised. Bug #108219.

> Additionaly it would be nice if the current setting would 
> be displayed somewhere, in the current state the user can 
> only guess.

Heh. The original calctool (OpenWindows DeskSet, circa 1992)
has this. See:
http://calctool.sourceforge.net/Screenshots/calctool_ss.gif

Cc:'ing Calum Benson, one of the GNOME HCI engineers, to see 
if we should try to put some thing like this back.
 
Comment 2 martin H. 2003-03-12 20:10:29 UTC
>Does setting accuracy (Acc) to "0 radix places" give you want 
>you want here? If not, could you explain it in more detail please?

No, Acc=0 truncates the number after the period. What i would like to
see is a mode that truncates after the last significant digit if it is
after the decimal point or at the dicimal point if it is before.

This allows to see, without changing the Accuracy:

"755"
"6.5"
"6.5678"
"0.457654"

So you don't get distracting trailing zeros while still seeing the
fractional part.
I think this would of course be limited to a given number of digits
after the decimal point.


> These are there. The "Eng" and "Sci" radio buttons in the
> mode panel above the main calculator buttons (in Scientific mode).

Yes, you're right, I missed them. But i think widgets are not in the
ideal place. I think this would be easier to see if these wigdets
weren't at two totally different locations. Maybe you could move one
of them next to the other. Say Acc up to the radioboxes. gcalctool
wouldn't be hurt by a bit more grouping (maybe even spacing to make
the grouping more explicit). At the moment it is mostly layouted by
technical points (all radiogroups in one location, commen part of all
modes). But maybe this is for a different bug.

Comment 3 Calum Benson 2003-03-13 18:14:57 UTC
I think the "no trailing zeroes" option is basically what I was asking
for in bug #104904.
Comment 4 martin H. 2003-03-13 19:42:12 UTC
Yes, you're right. Lucky me filed this bug as enhancement request so
maybe this won't be resolved as NOTABUG. I think this feature should
really be there. 

From the documentation of Accuracy I would say it only affects the
display and the registers accessed with sto, rcl and exch, so it
shouldn't be to hard to implemnt this. If this assumsation is wrong it
has to be documented in a more obvious way (and increasing Acc while a
value is displayed shoud maybe give a warning).
Comment 5 Rich Burridge 2003-03-14 15:17:33 UTC
*** Bug 104904 has been marked as a duplicate of this bug. ***
Comment 6 Rich Burridge 2003-03-14 15:37:51 UTC
Adding Breda to the Cc: line as this is a possible
change that will affect the online help.

I've been thinking about this, and I believe it's
actually a lot simpler than I'd originally thought.

I propose the following changes:

* The menu items in the Acc menu are now "tickable",
  so you know what the current accuracy selection is.
  Setting one of these clears the previous one.

* A new "remove trailing zeroes" (better wording
  please) menu item is added to the Acc menu (first
  item, with a separator underneath perhaps), that is
  "tickable". This tick doesn't affect the accuracy
  ticks. It's either on or off.

* The default setting for accuracy now becomes 9 numeric
  places and "remove trailing zeroes".

* The Acc button is moved to the Scientific mode (clear
  slot in the top right corner, above the Rand.

With these changes, and the changes proposed in 
bug #108219 I think this makes it much more straight
forward to the novice user who will be in Basic mode and
only sees 9 decimal places with trailing zeroes removed.
This being almost the way that most software calculators
do it (although they tend to give more numeric places
which aren't always accurate).

The "power" user can go to the Scientific mode, and tweak
this to their hearts content.

gcalctool should use gconf resources to save the users
prefered accuracy and whether the "remove trailing zeroes"
toggle is on or off, and restore accordingly. If the user
is returning to Basic mode, then it's automatically set to
9 decimal places with "remove trailing zeroes".

Now where I think the debate maybe is going to be is over the
Financial mode. I'm proposing the same as the Basic mode. In
other words, the user is automatically set to decimal base
(as per bug #108219), and their accuracy is 9 numeric places
with trailing zeroes removed.

Does all this seems reasonable? If yes, Calum/Breda could you
please refine/agree to the wording of the "remove trailing 
zeroes" menu item and the other UI changes I've proposed please?

Thanks.


Comment 7 martin H. 2003-03-14 16:03:15 UTC
It seems reasonable. I don't know about financial mode because i don't
know about financial stuff.

If you are moving the Acc button, maybe you could get it near the
eng/sci/fix radiogroup so users can see these related thing close
together. I didn't look at the source, so I'm not sure how easy this
would be. The best position would be rigth (or left) of the radiobox,
but maybe this would look ugly because of the different height of the
controls.
Comment 8 Rich Burridge 2003-03-14 16:43:54 UTC
One possible solution (to putting the Acc button near the
base and display style radio buttons) would be to move the
Bin/Oct/Dec/Hex radio button group and the Eng/Fix/Sci radio
button group over to the right side of the mode panel, and put
the Degrees/Gradients/Radians radio button group and the
Hyp and Inv checkboxes on the left side. The Acc button (if
placed above the Rand button) would then be in very close
proximity without looking too ugly.

Calum/Breda: comments?
Comment 9 Rich Burridge 2003-03-17 23:23:30 UTC
Created attachment 15085 [details]
Patch to implement required functionality.
Comment 10 Rich Burridge 2003-03-17 23:28:54 UTC
I've added a patch to this bug that hopefully implements
the functionality described above. Calum/Martin, I'd
appreciate it if you can checkout the latest gcalctool,
apply this patch, try it out and let me know what you think.
Personally I really like it, and wonder why I've never had
anybody ask me for this in the 15 years I've been doing this
calculator (in its various guises. ;-)

Note that I've implemented it so the mantissa for eng/sci
numbers is also affected by the "Remove Trailing Zeroes"
flag. This seems reasonable, and you simple toggle the menu
item (or do Control-R) to reverse the effect.

I'm going to give this a bit more testing to see if I've missed anything.

Comment 11 Rich Burridge 2003-03-18 11:24:51 UTC
The patch doesn't correctly reset the mode to "remove
trailing zeroes" when going from Scientific to Basic
or Financial more, so it isn't exactly right. Also it
needs to adjust the initial "accuracy" value in the gcalctool
schemas file, and add in a section for the new "removezeroes"
resource. 

Hopefully it gives an idea what this will all look like
though.

Calum can you comment on the UI changes please?

Martin, can you indicate whether this is what you 
were looking for please?

Thanks.
Comment 12 Rich Burridge 2003-03-18 12:05:33 UTC
Created attachment 15094 [details]
Provide required functionality (take 2).
Comment 13 Rich Burridge 2003-03-18 12:06:25 UTC
I've added a new patch that hopefully now provides all
the required functionality. Please try it out.
Comment 14 Rich Burridge 2003-03-18 16:31:32 UTC
Chatted with Calum on IRC this morning, and he's
okay with these changes. Fixed in v4.2.74. 

Martin/Dennis, if you find any strangeness, please
reopen the bug and comment, and I'll look at it
when I return from the CSUN conference next week.

Thanks.
Comment 15 Calum Benson 2003-03-18 17:13:26 UTC
Yeah, all seems reasonably sane to me.  I suspect it might make
slightly more sense to call the feature "Show Trailing Zeroes" (or
similar-- Breda?) and have it turned off by default, though, rather
than calling it "Remove Trailing Zeroes" and having it turned on by
default... just seems a bit counter-intuitive to have to turn
something on to make something disappear :)

I think it might also be a good idea to add this option to the View
menu, enabling it only in scientific mode of course.  Anything that
can be accessed by a Ctrl-<blah> shortcut just feels like it ought to
be present on the main menubar somewhere.
Comment 16 Rich Burridge 2003-03-18 21:12:50 UTC
You're suggestions sound great. I'll probably look at
adjusting this after CSUN (i.e. next week), as I don't
want to rush it and possibly check in a bad patch.

Now that there would be two menu items doing the same
thing, I think it makes sense to have a separate function
to call for these two items rather than try to generalise
in mb_proc and menu_proc.
Comment 17 Breda McColgan 2003-03-18 23:36:11 UTC
I agree with Calum's suggestions. I contemplated suggesting the text
"Right-pad with Zeroes" instead of "Show Trailing Zeroes", but I think
the latter is more accurate.

Not sure what "two menu items" Rich is talking about? Calum suggested
adding a new option "View > Show Trailing Zeroes"; what is the other item?
Comment 18 Rich Burridge 2003-03-19 04:32:50 UTC
Hi Breda,

It's now actually the same menu item but in two places.
It'll be in the "Acc" menu, but because it has a 
Control-<blah> shortcut, it should also be in the menubar,
so it's going to be added to the View menu there.

More in a few days.

Comment 19 Rich Burridge 2003-03-24 20:03:08 UTC
Created attachment 15190 [details]
Patch file to adjust to "Show Trailing Zeroes" style.
Comment 20 Rich Burridge 2003-03-24 20:05:18 UTC
Even though I believe I've now adjusted this to the
"Show Trailing Zeroes" style, with the extra equivalent
menu item in the View menu in the menubar, I'm attaching
the patch of changes because I consider the approach I
had to take to fix this a ReallyAwfulKludge(TM). A second
pair of eyes on this might come up with a cleaner approach.

Anyway, fixed in 4.2.76.