File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Java equivalent of setw Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Java equivalent of setw" Watch "Java equivalent of setw" New topic

Java equivalent of setw

Stephen Ma

Joined: Sep 21, 2003
Posts: 7
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

Joined: Jul 08, 2003
Posts: 24199

Hi Stephen,
Welcome to JavaRanch!
Use the java.util.DecimalFormat class. No, it's not as convenient as setw.

[Jess in Action][AskingGoodQuestions]
Stephen Ma

Joined: Sep 21, 2003
Posts: 7
Thanks a bunch, I'll give it a shot! This place is great!
I agree. Here's the link:
subject: Java equivalent of setw
jQuery in Action, 3rd edition