Bug 271057 - kcalc negative numbers ui problem
Summary: kcalc negative numbers ui problem
Status: RESOLVED WORKSFORME
Alias: None
Product: kcalc
Classification: Applications
Component: general (show other bugs)
Version: 2.7
Platform: Ubuntu Linux
: NOR wishlist
Target Milestone: ---
Assignee: Evan Teran
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-15 21:44 UTC by Maarten Bezemer
Modified: 2011-04-19 22:45 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maarten Bezemer 2011-04-15 21:44:31 UTC
Version:           2.7 (using KDE 4.5.1) 
OS:                Linux

When I click -5 in kcalc it shows as 5 and only when I press = will it show as -5. This is horrible as when I type -5+2 it doesn't show the sign and will be left wondering whether I have pressed the negative sign. Please show the negative sign when I have typed.

Reproducible: Always

Steps to Reproduce:
type - and 5

Actual Results:  
you only see 5

Expected Results:  
It is expected to see -5

LP #668020: https://bugs.launchpad.net/ubuntu/+source/kdeutils/+bug/668020
Comment 1 Evan Teran 2011-04-19 17:27:40 UTC
I believe that you are pressing the subtract button "-", then 5, then equals "=". That is actually not the correct way to create negative number! What that does is take the current value (0 when you start the calculator), then subtracts 5 from it when you hit equals. Which of course results in negative 5.

The correct way to input a negative number is instead to enter the value you want (5) and then to use the "+/-" button (located in the lower right in all modes). This will immediately toggle the sign of the value.

So, if you wanted to calculate "5 * -10", you would press the following keys:

5
x (multiply)
10
+/-
=

I hope this helps.
Comment 2 Maarten Bezemer 2011-04-19 17:47:46 UTC
I try not to press number but use my keyboard, which does not have a "+/-" key.
So to type "-5", I type "-" and "5" which indeed acts as "-5", since I can continue typing "+", "2" and "=" to get the correct result "-3".

The 'problem' is that I do not see "-5" when I type "-" and "5", which would be the expected output. Especially since kcalc acts correctly as if "-5" is present.
Comment 3 Christoph Feck 2011-04-19 19:22:48 UTC
If you want to toggle the sign using the keyboard, use the \ key.

Tip: Hold Ctrl to see the keyboard shortcuts.
Comment 4 Christoph Feck 2011-04-19 19:27:30 UTC
See also bug 240082 comment #9.
Comment 5 Evan Teran 2011-04-19 22:45:14 UTC
@Maarten Bezeme, When type the keyboard keys: "-5+2=", you are actually telling kcalc to calculate: "0-5+2=".

Christoph Feck offers the correct keyboard solution. It is possible that "\" is not the best keyboard shortcut for "invert sign", but that's a different discussion.