Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java equivalent of setw

 
Stephen Ma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to find the Java equivalent of setw in C++. Any tips on formatting will be greatly appreciated. I tried searching for this in earlier posts but I can't find it. Thanks!
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stephen,
Welcome to JavaRanch!
Use the java.util.DecimalFormat class. No, it's not as convenient as setw.
 
Stephen Ma
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a bunch, I'll give it a shot! This place is great!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic