Strip trailing zeros so whole numbers do not have a decimal place

Commit 0fa64634 limited output to 2 decimal places, but had the
unintended side effect of always displaying two decimal places, even
when the result is a whole number.