Exercise 3.17: doubleToString