I have a double. I'm printing to file using a FileOutputStream. How can I print only 2 decimal places... and can I add trailing zeros if necessary? Thanks.
Printable View
I have a double. I'm printing to file using a FileOutputStream. How can I print only 2 decimal places... and can I add trailing zeros if necessary? Thanks.
Use java.text.NumberFormat