As expected, the floating point number (1.9876) was rounded up to two decimal places – 1.99. So %.2f means to round up to two decimal places. You can play around with the code to see what happens as you change the number in the formatter.