PDA

View Full Version : formatting text for output to a text file.




Eraserhead
Aug 6, 2006, 06:35 AM
Is it possible to format output to a text file from Java (ie limiting the number of decimal places shown of numbers.) in a similar way to using printf to print formatted text on the screen.



HiRez
Aug 6, 2006, 06:47 AM
Use the NumberFormat class with its format() method to output to your file stream.

Eraserhead
Aug 6, 2006, 07:34 AM
Thanks for that.