Vincent_Ardern Posted October 31, 2021 Share Posted October 31, 2021 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
vitor Posted October 31, 2021 Share Posted October 31, 2021 Welcome @Vincent_Ardern, There you go. Vincent_Ardern 1 Link to comment
Vincent_Ardern Posted November 1, 2021 Author Share Posted November 1, 2021 (edited) 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. Hmm. It occurs to me that this is integer values, not float / double. I'll investigate further Edited November 1, 2021 by Vincent_Ardern Link to comment
deanishe Posted November 1, 2021 Share Posted November 1, 2021 6 hours ago, Vincent_Ardern said: It occurs to me that this is integer values, not float / double That's not true for Vítor's original. Don't know what you've done with your modified version. Link to comment
vitor Posted November 1, 2021 Share Posted November 1, 2021 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. Vincent_Ardern 1 Link to comment
Vincent_Ardern Posted November 1, 2021 Author Share Posted November 1, 2021 Thanks @vitor. I should have updated it myself after I discovered that fix yesterday. I learnt too much about BigDecimal before I realised that the input being converted was the issue. Cheers 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