Jump to content

How can I create a keyword workflow to calculate GST?


Recommended Posts

I'd love to create a workflow that lets me type in "gst 1000" and have the result become "1150".

 

In my local jurisdiction goods and services tax is 15% on top of the product price. I think if somebody can give me a simple workflow for this then I can tinker with it for the other options around GST inclusive / exclusive. Thanks

Link to comment

Thanks @vitor I've added an almost identical script filter so that I can use "gst" as a keyword for either inclusive or exclusive. I've already learnt quite a bit about how each part of the workflow contributes to the outcome thanks to your solution which is relevant to my tasks. (Among other things) I didn't understand how to set the prompt text for each result until now so I'm very happy with this.

CleanShot 2021-11-01 at 13.04.55.png

 

Hmm. It occurs to me that this is integer values, not float / double. I'll investigate further

Edited by Vincent_Ardern
Link to comment

It does give you a float as the output but the input is converted to an integer before the calculation. Focused too close on your example, which is funny because I based this on another Workflow I made which did use the input as a float. Easy fix: where you see ARGV[0].to_i, change to ARGV[0].to_f.

Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...