A number format only changes how a value looks: 2.456 formatted with two decimals shows 2.46 but is still 2.456 underneath, and totals use the full value. When the rounded number is what counts (an invoice line, a price, a tax amount), round it with a function:
=ROUND(number, num_digits) rounds to the nearest, halves away from zero.
=ROUNDUP always rounds away from zero; =ROUNDDOWN always toward zero.
num_digits is the number of decimal places: 2 for cents, 0 for whole numbers, and negative to round to the left of the decimal point: -2 rounds to the nearest hundred.
This matters when lines are rounded but the total isn't: a column of rounded line items can add up to a cent or two more or less than the rounded total.