ixium Posted February 15, 2017 Share Posted February 15, 2017 How do I preform simple calculations in a workflow, I need to have the workflow take my input and do this {querr}*(1/60)= very simple, just not sure how to make a workflow do that. Thank you Link to comment
dfay Posted February 15, 2017 Share Posted February 15, 2017 well the easiest way to do this is just to use the built in calculator feature or if RPN is your thing there's this which I made but never use - or you can use bash and bc: http://unix.stackexchange.com/questions/30478/doing-simple-math-on-the-command-line-using-bash-functions-1-divided-by-2-us Link to comment
ixium Posted February 16, 2017 Author Share Posted February 16, 2017 Yea im just trying to find a way to use the built in calculator quicker, its a simple calculation I have to do often for time entires. I will look at the literature you provided, thank you Link to comment
ixium Posted February 16, 2017 Author Share Posted February 16, 2017 Hmm that didnt seem to do the trick and the other stuff is way over my head. Im looking for something to do this exactly I input {query} it takes that and preforms 2 calculations and outputs both results {query}*(1/60)=Decimal then Decimal*25= $Result then I need to paste Decimal and $Result I did find a workflow that was made a few years ago with a workflow that did the first part of this calculation but that link is now dead, anyone have any ideas, im surprised there isnt a simple function in workflows to do calculations, I dont know much about this stuff though Link to comment
dfay Posted February 16, 2017 Share Posted February 16, 2017 (edited) Try this in a Run Script box with language as python and input as {query}. You can pipe it out to a Copy to Clipboard action. query="{query}" x = float(query)/60 y = x*25 print x,y Edited February 16, 2017 by dfay Link to comment
ixium Posted February 16, 2017 Author Share Posted February 16, 2017 that is awesome, thank you so much! Is there any way to restrict it to only 2 points after the decimal, thank you so much for the help! Link to comment
dfay Posted February 16, 2017 Share Posted February 16, 2017 query="{query}" x = float(query)/60 y = x*25 print "%.2f" % x, "%.2f" % y Link to comment
ixium Posted February 16, 2017 Author Share Posted February 16, 2017 You are incredible, thank you so much! Link to comment
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