They calculate all fees plus any discounts (if applicable), and round this once to the nearest penny before applying VAT (if applicable).