bkmontgomery Posted August 10, 2014 Posted August 10, 2014 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. benjamin74 1
Don Dahl Posted August 10, 2014 Posted August 10, 2014 Interesting! How about adding more percentage stuff to the workflow as well? If it houses other formulas it'd become utterly useful i believe!
bkmontgomery Posted August 11, 2014 Author Posted August 11, 2014 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!
Easytiger Posted August 14, 2014 Posted August 14, 2014 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!
bkmontgomery Posted August 14, 2014 Author Posted August 14, 2014 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! Don Dahl 1
Easytiger Posted August 14, 2014 Posted August 14, 2014 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!
deanishe Posted August 15, 2014 Posted August 15, 2014 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). Easytiger and bkmontgomery 2
bkmontgomery Posted August 16, 2014 Author Posted August 16, 2014 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. Don Dahl and Easytiger 2
bkmontgomery Posted August 24, 2014 Author Posted August 24, 2014 (edited) 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 August 24, 2014 by bkmontgomery deanishe 1
Don Dahl Posted August 24, 2014 Posted August 24, 2014 Cool work! It has become useful now. Good for educational use
sudopeople Posted September 12, 2014 Posted September 12, 2014 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.) Don Dahl, bkmontgomery and Easytiger 3
bkmontgomery Posted September 15, 2014 Author Posted September 15, 2014 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! Easytiger 1
bkmontgomery Posted September 20, 2014 Author Posted September 20, 2014 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
Acidham Posted December 1, 2015 Posted December 1, 2015 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.
Acidham Posted December 7, 2015 Posted December 7, 2015 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"
deanishe Posted December 7, 2015 Posted December 7, 2015 (edited) 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 December 7, 2015 by deanishe
bkmontgomery Posted October 30, 2017 Author Posted October 30, 2017 Hi All, I've finally published a long-overdue update to this that includes: Support for Alfred 3 (Thanks deanishe for making that easy) Ability to copy the result w/ ⌘+C Changed text "Portion of" to "Percentage of" You can download it now from Github.
adam_wagner Posted August 19, 2018 Posted August 19, 2018 (edited) 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 a is b% less than? 2. What is the original number that number a 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 ? Edited August 19, 2018 by adam_wagner benjamin74 1
bkmontgomery Posted December 27, 2018 Author Posted December 27, 2018 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! :) benjamin74 1
benjamin74 Posted February 24, 2021 Posted February 24, 2021 @bkmontgomery and @adam_wagner awesome work, super useful especially when trading
dtoub Posted March 5, 2021 Posted March 5, 2021 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.
dtoub Posted February 2, 2022 Posted February 2, 2022 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 😉
dtoub Posted February 2, 2022 Posted February 2, 2022 I reinstalled Python 2 (2.7.18) and unfortunately that did not fix the issue.
vitor Posted February 3, 2022 Posted February 3, 2022 If you’ve followed the knowledge base article to reinstall Python 2, this version should work for you. It modifies the Workflow just enough for it to work with the newly installed Python 2.
giovanni Posted March 30, 2022 Posted March 30, 2022 @dtoub this is migrated https://github.com/giovannicoppola/alfred-percent-change Viver de Dividendos 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now