formatting text for output to a text file.

Discussion in 'Mac Programming' started by Eraserhead, Aug 6, 2006.

  1. macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK
    #1
    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.
     
  2. macrumors 601

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    Use the NumberFormat class with its format() method to output to your file stream.
     
  3. thread starter macrumors G4

    Eraserhead

    Joined:
    Nov 3, 2005
    Location:
    UK

Share This Page