How do I limit the number of decimals printed for a double?
Use a DecimalFormatter: Will give you “0.99”. You can add or subtract 0 on the right side to get more or less decimals. Or use ‘#’ on the right to make the additional digits optional, as in with #.## (0.30) would drop the trailing 0 to become (0.3).