aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes Formatting numbers in a JTextArea Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Formatting numbers in a JTextArea" Watch "Formatting numbers in a JTextArea" New topic
Author

Formatting numbers in a JTextArea

Luigi Plinge
Ranch Hand

Joined: Jan 06, 2011
Posts: 441

What's the best way of doing this?

JTextArea doesn't have a "printf" method, just "append".

For example



I want to cut the number calculated in this expression down to 2 decimal places.
Luigi Plinge
Ranch Hand

Joined: Jan 06, 2011
Posts: 441

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

Thanks for sharing the solution!


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Formatting numbers in a JTextArea