Calculate VAT
FreeLogic@rabbinatix/calculate-vat by Rabbinatixupdated Sep 30, 2026
VAT and gross total from a net amount and a rate.
Give it the net amount and the ratePercent (22 for 22 %). It returns the vat and the total including VAT.
How to use it
Add it to your logic, then add a Call Function step in any logic and pick Calculate VAT. It belongs to no system, so every system can use it. Or download the TypeScript and call it from your own code.
Inputs
amount: Number
ratePercent: Number
Outputs
vat: Number
total: Number
Previewdrag the steps around; scroll to zoom
Function Entry, Input / output. 0 inputs, 3 outputs. step 1 of 5
Calculate VAT
amount
ratePercent
Multiply, Operators. 2 inputs, 1 output. step 2 of 5
*
A
B
result
Divide, Operators. 2 inputs, 1 output. step 3 of 5
/
A
B
result
Add, Operators. 2 inputs, 1 output. step 4 of 5
+
A
B
result
Return, Input / output. 3 inputs, 0 outputs. step 5 of 5
Return
vat
total
Arrow keys: next or previous step in flow order. Alt with arrows: nearest step in that direction. Enter: open. Shift F10: more actions.
Examplesrun live against the logic · 2/2 pass
| Passed | Example | Input | Output |
|---|---|---|---|
| Italy 22 % | {"amount":100,"ratePercent":22} | {"vat":22,"total":122} | |
| Zero rate | {"amount":50,"ratePercent":0} | {"vat":0,"total":50} |
Try it
Versions
In this package
Calculate VAT (entry)
