Jump to content

Taxes calculation workflow


Recommended Posts

Hi,

 

I’m trying to put a script together to do the math for my taxes calculation. I could do a Numbers spreadsheet, but I love the idea to have it at my fingertips.

 

Here is the current workflow.

 

The top one works great, but will not produce any output when I input numbers with comma (600,50) or point (600.50).

 

 

I was trying to build the bottom one as a script filter, but I lacks some knowledge to pursue that further.

 

 

Thanks for having a look at it!

 

 

 

Capture%20d%E2%80%99%C3%A9cran%202014-02

Link to comment

The top one isn’t producing any output when you input a value with decimals because you’re setting it as an integer (a whole number). The solve it, simply change input = int("{query}") to input = float("{query}").

For the second case, when creating a new workflow, instead of choosing Blank Workflow, pick ExamplesScript Filter XML format, to see how it should be structured. There are also some python modules to help with that (there are more that you can find on the forums and github). Those examples are well documented, so you should take a look at them first. If you encounter difficulties, feel free to ask about them, as this community is very receptive to questions.

Edited by Vítor
Link to comment

Using “.” is the correct syntax. However, if you really want to use “,” as a decimal separator, what you can do is change the same line mentioned above to input = float("{query}".replace(',','.')); this way “,” will be replaced by “.” when present, and the rest of the script can continue to function as usual.

Link to comment
  • 3 years later...

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...