## On Rounding

This is just a wee bitch about Microsoft's permanent need to improve our programming lives. In this case, it's about rounding numbers to two decimal places.

In the UK, Value Added Tax (VAT) is 17.5%. If something costs £2.00 then £0.35 is added in VAT making a total paid of £2.35. If something costs £2.20 then 17.5% is £0.385 which either £0.38 or £0.39 depending on whether you round up or round down.

At school, I was taught to round up if the number ended in 5. And that's what the Excel rounding routines (see above) do. It's also what the SQL Server ROUND function does - see below.

<< Home