You can have the total of your tax on the invoice calculated either per invoice item or rounded from the total of the invoice.
If you round every invoice item, the total VAT is calculated this way:
And if you calculate from the total the tax is calculated from the total sum.
The typical and recommended way to calculate the VAT is from the total invoice amount.