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 480207 - Make addition and subtraction of percentages take percentage of value on left-hand side
Make addition and subtraction of percentages take percentage of value on left...
Status: RESOLVED FIXED
Product: gnome-calculator
Classification: Core
Component: general
unspecified
Other All
: Normal enhancement
: 2.28.0
Assigned To: gcalctool maintainers
gcalctool maintainers
: 571185 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2007-09-25 13:24 UTC by Flavio daCosta
Modified: 2009-06-16 05:27 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Flavio daCosta 2007-09-25 13:24:18 UTC
Please describe the problem:
When doing subtraction/addition using the percent (%) key, the result is not the same as it is on most calculators with a percent key.

Steps to reproduce:
Enter into caclulator:
1. 200
2. -
3. 10
4. %
5. =




Actual results:
200 - 10% = 199.9

Expected results:
200 - 10% = 180

Does this happen every time?
yes

Other information:
This works as expected on my hand calculator, palm pilot and cell phone.

Was expecting similar behavior as displayed on this site (ignoring the "shift" keypress): <http://www.calculator.org/CalcHelp/basics.htm>

Calculate 12% mark-up on $250
250 + 12 shift %
Result: $280

Give 5% discount on goods costing $125
125 - 5 shift %
Result: $118.75
Comment 1 Rich Burridge 2007-09-25 13:53:21 UTC
In the past, when this has come up (see bug #135140 and bug #161368 
and bug #165687 and bug #319934). In particular, see bug #135140 for
why gcalctool percent works the way it does.

Having said that, this is the fifth such bug, so instead of closing
it as a duplicate, I'll mark it as an enhancement request. If somebody
supplies a patch, then this functionality can be changed.

Thanks.
Comment 2 Rich Burridge 2007-11-03 15:36:03 UTC
Now that we've got a "gcalctool-maint@gnome.bugs" alias, I'm
reassigning several bugs and enhancement back to that. They
are free to be picked up by one of the team and worked on.
Comment 3 Robert Ancell 2009-02-27 13:46:37 UTC
*** Bug 571185 has been marked as a duplicate of this bug. ***
Comment 4 Robert Ancell 2009-03-27 14:42:00 UTC
From https://bugs.launchpad.net/gcalctool/+bug/328094:
not correctly calculates percent (see animated GIFs below)
http://img23.imageshack.us/my.php?image=calcgnomegd9.gif
for example same actions on other calculators
KCalc (KDE 4.2) http://img25.imageshack.us/my.php?image=calckde2yt4.gif
Calculator (Windows XP) http://img23.imageshack.us/my.php?image=calcwineb9.gif
Hardware calculator CITIZEN http://img23.imageshack.us/my.php?image=calccitizenyh2.gif
Comment 5 Robert Ancell 2009-06-16 05:27:37 UTC
Managed to work out how to fix this finally:
http://git.gnome.org/cgit/gcalctool/commit/?id=6b50d96b8258b5757aae05c02d2cc0fdebd4e0b7

This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.