New feature request - percentages calculation

253 views
Skip to first unread message

whyamionfire

unread,
Aug 7, 2009, 6:45:27 PM8/7/09
to speedcrunch
This is something that would save me a lot of time and I would love
speedcrunch even more for it. Here is an example problem:

35 - 7% = ANSWER

Right now, speed crunch does this...

35 - .07 = 34.95

This is what I would prefer it to do (this is what wolfram alpha
does)....

35 - (35 * .07) = 32.55

This would help me out a LOT. I use speedcrunch all day long at work,
and I do this calculation a lot.

Helder Correia

unread,
Aug 10, 2009, 7:20:17 AM8/10/09
to speed...@googlegroups.com
Hi

I do agree with you, please read my comment on
http://code.google.com/p/speedcrunch/issues/detail?id=239

Frederic Da Vitoria

unread,
Aug 10, 2009, 12:09:36 PM8/10/09
to speed...@googlegroups.com
2009/8/8 whyamionfire <whyami...@gmail.com>:

We'd need to tell speedcrunch somehow how to make the difference
between the straight 35 - 0.07 and 35 - (35 * .07) What about
35 - 7%

Currently, it seems that when you type this in speedcrunch, it understands
35 - (7% of 1)

while you are hoping for
35 - (7% of 35)

So this would mean that speedcrunch should suppose that the % is
applied to the last term instead of 1. In other words
A - B% <=> A - B% * A
but
A - B% * C
would keep it's current meaning.

Is this easy to implement?

--
Frederic Da Vitoria
(davitof)

Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org

Helder Correia

unread,
Aug 10, 2009, 4:15:18 PM8/10/09
to speed...@googlegroups.com
>  A - B% <=> A - B% * A
> but
>  A - B% * C
> would keep it's current meaning.
> Is this easy to implement?

Haven't evaluated the effort, although I'm sure beforehand that it
won't be trivial, but there's another option: when the user presses %,
the editor inserts the " * C" part automatically.

Helder Correia

unread,
Aug 10, 2009, 4:15:50 PM8/10/09
to speed...@googlegroups.com

I obviously meant " * A" here.

Frederic Da Vitoria

unread,
Aug 10, 2009, 4:40:09 PM8/10/09
to speed...@googlegroups.com
2009/8/10 Helder Correia <helder.pere...@gmail.com>:

Good idea. Your idea has the advantage of being more mathematically correct ;-)

whyamionfire

unread,
Aug 10, 2009, 6:00:36 PM8/10/09
to speedcrunch
I like that. That would probably be much easier to implement... plus
it has the added benefit of giving the user a choice. Maybe take it
one step further and retain the current functionality exactly as it
is, but if you type in

A - B%

Instead of pressing "Enter", if you press Shift+Enter or something
like that... then the parser would automatically calculate it as

A - (A * B%)

Or to go even a step further... what if it did this:

5 - 25% = 4.75 (same functionality)
5 - %25 = 3.75

I know it's not strictly correct, but it would be an easy way to
distinguish functionalities.

On Aug 10, 4:15 pm, Helder Correia <helder.pereira.corr...@gmail.com>
wrote:
Reply all
Reply to author
Forward
0 new messages