Totals are not calculated using tax codes. Tax codes are applied, and calculations are made and rounded to the defined decimal accuracy of the currency in use for the transaction, at the line item level. Line item quantities are simply summed to derive totals.
If the rounding option is chosen on a sales invoice, you can choose to round to nearest or round down. In either case, the rounding is to a whole unit of the currency, not tens, hundreds, or thousands, etc. A fraction of .5 is rounded up when rounded to nearest.