Jump to content
Jb_Bryant

Percentages in Alfred calculator

Recommended Posts

I agree entirely!  I am constantly calculating percentages.  For example, I'd LOVE to type "100+10%" to get the result "110".  Currently, I have to type "100+(100*.10)" to achieve the same result.

 

Thanks for considering this improvement, and of course, for an already awesome app!   :)

Share this post


Link to post
Share on other sites

Due to the nature of Alfred's calculator (which is based on CGMathParser), it uses the % mark as mod remainder... so =23%10 equals 3.

 

There are a few normal calculator workflows on the forum which may treat % differently, but at this point, I have no intention to modify CGMathParser. I do have a note of this in my bug tracker though, so will keep it in mind.

Share this post


Link to post
Share on other sites

Hi Andrew,

 

I've tried googling around for a layman explanation of GCMathParser's method of doing percentages but it doesn't seem very straightforward. =10%100 = 10 (ok this is easy!) =10%200 = 10 (hang on…) = 10%1000 = 10 (wtf?). I had come across the Percentage plugin and have been using that, which seems much more sensible in usage (to me anyway).

 

Cheers

Share this post


Link to post
Share on other sites

Hi Andrew,

I've tried googling around for a layman explanation of GCMathParser's method of doing percentages but it doesn't seem very straightforward. =10%100 = 10 (ok this is easy!) =10%200 = 10 (hang on…) = 10%1000 = 10 (wtf?). I had come across the Percentage plugin and have been using that, which seems much more sensible in usage (to me anyway).

Cheers

The % operator means "remainder" in GCMathParser (and in many programming languages). So 7 % 3 = 1, because 7 divided by 3 is 2 *remainder 1*. 10 % 10 is actually 0, because 10 divides into 10 once with *no remainder*.

Try typing "7 % 3" into Google; you should see the same result Alfred gives you.

I might also note: few computer languages have an operator for percentages, just because its so simple to do with division (divide by 100, multiply by percentage)

Hope this helps

Share this post


Link to post
Share on other sites

Hello mate,

 

Thanks for explaining the theory of it.

 

It might be simple to do using the other route but it takes 25% longer to complete a calc*. If you're doing 1000 calcs a day this adds up pretty quickly. I might be missing something but that's why I use calculators that are able to do x + y%. 

 

*for industries that aren't programming-related, I suppose.

 

Cheers

HP

Share this post


Link to post
Share on other sites

Isn't multiplication an acceptable alternative?

 

25 + 20% = 25 * 1.2

127 + 45% = 127 * 1.45

390 - 17% = 390 * 0.83

etc.

 

To work out what percentage x is of y, do x / y (and multiply by 100 if you really need to):

25 / 100 = 0.25 (i.e. 25%)

37 / 82 = 0.45 (i.e. 45%)

etc.

Edited by deanishe

Share this post


Link to post
Share on other sites

Hello Deanishe,

 

I would have to politely disagree as that is akin to asking why one would bother with Alfred at all given that you can do everything it offers the long way. This is why our office has physical calculators with the percentage function… to save time. 

 

Cheers,

HP

Edited by hpsauce

Share this post


Link to post
Share on other sites

In all seriousness, if calculating percentages is such a big thing for you, why do you want to do it with a launcher app instead of an app designed specifically for that kind of thing?

 

Given the way Alfred does maths (which won't be changing anytime soon, according to Andrew), that's the fastest way to calculate percentages.

 

I'm sorry if my suggestion isn't acceptable to you, but it might be helpful to someone like designjoe above who's been using "100+(100*.10)" instead of "100*1.1".

Edited by deanishe

Share this post


Link to post
Share on other sites

You are quite right - that is helpful

 

Why Alfred? Because it's faster than anything else to invoke (unless I go and make a custom shortcut to a separate app). Fair point though.

 

Cheers,

HP

Share this post


Link to post
Share on other sites

The problem is that 100 plus 10% is actually $111.11. Try it on a calculator...$111.11 x 90% = $100.00. $110 x 90% = $99.00

 

Another example...add 6% comission to a $500,000 sales price of a house. Most people would use $500,000 x 6% = $30,000. That means the seller would end up with $470,000. The correct method is $500,000 divided by .94 = $531,914.89. Now, the seller ends up with exactly $500,000 after deducting 6% - $531,914.89 - 6% = $500,000.

 

I would really like to have a way to figure examples like this with Alfred.

Share this post


Link to post
Share on other sites

The problem is that 100 plus 10% is actually $111.11.

No, it isn't. 100 plus 10% is 110. And 6% of 500,000 is 30,000.

You're asking a different question, namely "what figure, when 10%/6% is deducted, leaves me with 100/500,000".

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...