I have a double read from an input file. I'm not sure if it is bigger than 10 or less than 10, but I always want it to come out as five characters (including the decimal). So, if it is 10.321789, I want to truncate it to 10.32. But if it is 9.98765, I want to truncate it to 9.987 (or 9.988 if possible). Is there an easy way to do this, without checking if the double is >= 10?