# Percent Change

## Recommended Posts

Hi All,

I'm new here, and I've just created my first workflow: Percent Change. For some reason, I can never do this in my head, and I'm tiring of looking up the formula.

This workflow lets you calculate the percent of change between two values, using the % symbol:

`% <value1> <value2>`

So, something like % 3 6 would give you a result of 100. The result is displayed in Large text and copied to the clipboard.  You can find it, here:

http://www.packal.org/workflow/percent-change

I'd love any feedback.

Interesting! How about adding more percentage stuff to the workflow as well? If it houses other formulas it'd become utterly useful i believe!

I'd be all for this. Do you have anything in mind?

I'd be awesome if we had a list of things people would expect from this workflow.

Interesting! How about adding more percentage stuff to the workflow as well? If it houses other formulas it'd become utterly useful i believe!

Thanks for this perfect workflow. It would be great to have the output in a smaller way or as a sort of "live output" just like the normal calculations I can do within Alfred.

Besides percentage change it would be great to get the basics of calculations of percentage, e.g. the percentage of something.

Just my first thoughts, will think about this in more detail as this workflow is just awesome as I assume I will use it very often.

Thanks for that!

Thanks for the feedback!  I admit, that I don't like the large output either. I've found that I tend to do 2 or 3 calculations in a row, so I'll try to figure out how to get live output.

As for other calculations, I can think these might be useful:

• What percent of X is Y
• What is X percent from Y

I'd be happy to incorporate any others!

Thanks for this perfect workflow. It would be great to have the output in a smaller way or as a sort of "live output" just like the normal calculations I can do within Alfred.

Besides percentage change it would be great to get the basics of calculations of percentage, e.g. the percentage of something.

Just my first thoughts, will think about this in more detail as this workflow is just awesome as I assume I will use it very often.

Thanks for that!

Yeah, great that would be very useful to get another output format, if possible (which I think it is).

And yes, the suggestions you have made are exactly the ones I was currently thinking about. Mainly the ones I use regularly at work.

Cheers!

Thanks for the feedback!  I admit, that I don't like the large output either. I've found that I tend to do 2 or 3 calculations in a row, so I'll try to figure out how to get live output.

To get live output, you need to implement the workflow as a Script Filter.

Seeing as you're using Python, you might find my Python library useful (no need to mess around with XML yourself).

Updated to version 1.2.0, which includes new calculations.

http://www.packal.org/workflow/percent-change

1. Percent Change (increase/decrease): `% 3 6` -> 100%
2. Percent of; What is 3 percent of 100: `% 3 of 100` -> 3%
3. Percent Difference; What is 2 percent from 100: `% 100 - 2%`
4. Percent Increase; What is 100 + 2%: `% 100 + 2%`

Next version will be converted to a Script Filter.

Hi All, I've finally gotten a chance to convert this workflow over to a Script filter (Alfred-workflow is awesome, by the way), so you should now see results instantly, instead of having to wait for the large output.  I've also removed the copy to clipboard, since I never seemed to use that anyway.

You can get version 1.3.0 from http://www.packal.org/workflow/percent-change, or from https://github.com/bradmontgomery/alfred-percent-change

Let me know what you think.

Edited by bkmontgomery

Cool work! It has become useful now. Good for educational use

• 3 weeks later...

Great idea! I usually just struggle in the calculator until I get the answer that looks correct. I have a few thoughts on how it would be more useful...for me at least.

2. Percent of; What is 3 percent of 100: `% 3 of 100` -> 3%

A. The wording seems to be incorrect. "3 percent of 100" is indeed 3, but if you type "3 of 10" (which, in your wording would be "3 percent of 10") you get 30, presumably 30% - which is wrong of course. I suggest you change the example wording to "What percentage of 100 is 3:" or to keep the order and English correct, "3 is what percentage of 100:" and the subtext with the answer could be renamed to "Percentage of" to differentiate it from...

B. I expected, and would find useful, the ability to do exactly what your example text suggests: find out what 3% of 100 is. Or to make the examples more clear, what 3% of 10 is: 0.3. A command could be as simple as "3% of 10" - note the % symbol after the 3. The subtext of this would more accurately be "Percent of".

Because of some of the confusion, I think it would be a good idea to add a % symbol to the answer where applicable. Since you're not using copy to clipboard anymore, I don't imagine that would be a burden on anyone. And with all the new features being added and proposed, I think it would add a lot of clarity when trying different formulas.

New feature:

I also made a new icon so it's visible in the black:

Alone here:

FYI, if you delete the 3rd argument on line 92 of percent.py, it will use the % icon above for completed calculations. (I'm not sure if you intended to use the info icon. I prefer the percent symbol the whole time, but don't really care.)

Hi sudopeople,

This is great feedback!  I can see where the phrasing is confusing.  I won't get  a chance to work on this for about a week, but once I do, I'll come back to it and push out a new release incorporating your suggestions.

Thank you!

A new version is out! 1.4.0 changes the former 'percent of' to 'portion of', and introduces a new 'percent of' that makes more sense.  Here's the examples:

1. Percent Change (increase/decrease): `% 3 6` -> 100%
2. Portion of; 3 is what percent of 100: `% 3 of 100` -> 3%
3. Percent of: 5 percent of 100 is 5: `% 5 percent of 100` -> 5, or `% 5% of 100` -> 5
4. Percent Difference; What is 2 percent from 100: `% 100 - 2%`
5. Percent Increase; What is 100 + 2%: `% 100 + 2%`

Thanks for all the feedback!  Keep it coming
• 1 year later...

Would be great to copy it to the clipboard on enter. I tried to add "copy to clipboard" Output to the WF but result will not be copied.

Would be great to copy it to the clipboard on enter. I tried to add "copy to clipboard" Output to the WF but result will not be copied.

Done, change line 111 in percent.py from

```wf.add_item(title=results, subtitle=subtitle)
```

to

```wf.add_item(arg=results,valid=True,title=results, subtitle=subtitle)
```

and add WF step "Copy to Clipboard"

FWIW, as long as something is set for arg or copytext in wf.add_item(), you can hit ⌘+C on an Alfred result to copy it to the clipboard (i.e. you don't need valid=True if that makes no sense otherwise). By preference, copytext will by copied to the clipboard. If copytext isn't set, arg will be copied instead.

Edited by deanishe
• 1 year later...

Hi All,

I've finally published a long-overdue update to this that includes:

1. Support for Alfred 3 (Thanks deanishe for making that easy)
2. Ability to copy the result w/ ⌘+C
3. Changed text "Portion of" to "Percentage of"

• 9 months later...

Thanks for the great work @bkmontgomery!

I forked your repo and added two calculations that I frequently find useful:

1. What is the original number that number is b% less than?

2. What is the original number that number is b% more than?

These are tricky to remember how to calculate. These can be accessed by:

`% 100 is 2% lt`

`% 100 is 2% gt1`

You can grab the updated workflow here: https://github.com/AdamWagner/alfred-percent-change

@bkmontgomery, feel free to integrate changes into your original repo.

I haven't made it available on Packal because, honestly, I'm not sure how ?

• 4 months later...

Hi @adam_wagner, Thanks for your work on this! I've finally gotten around to pulling in your changes (which you can see on github), and adding the new version on packal!

Happy Holidays! :)

• 2 years later...

• 2 weeks later...

I've loved this workflow for a long time and appreciate all the fine work @bkmontgomeryand others. But I'm still not able to have this copy to the clipboard upon hitting return or enter (in fact, nothing happens at all when I do that) and can only do it by hitting cmd-C, which is nice but different from other workflows I use that work with copying to the clipboard. Any way to fix this? Thanks so much.

• 10 months later...

Hi. As with all workflows using Python 2, % Change is broken in the latest developer seed of Monterey. Any updates yet? Your workflow is indispensable and I'd love for it to work again on my system 😉

I reinstalled Python 2 (2.7.18) and unfortunately that did not fix the issue.

• 1 month later...

@dtoub this is migrated