File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Aline decimals Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Aline decimals" Watch "Aline decimals" New topic
Author

Aline decimals

Philip Pross
Ranch Hand

Joined: Jan 17, 2001
Posts: 76
For those who know C++, there is a format where you can aline decimals under each other (ex. like a telephone bill), but in Java I've search for the same kind of format in the NumberFormat & DecimalFormat.. and I haven't found it.
Maybe I'm blind, but I'm sure it exists!
Can anyone help me out
Thanks
Phil
Philip Pross
Ranch Hand

Joined: Jan 17, 2001
Posts: 76
The function is setw(int) in C++, does it exist in java???
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
You could use the decimalFormat() to make the number of digits after the decimal the same and the right justify them all. I can't find any other method.


"JavaRanch, where the deer and the Certified play" - David O'Meara
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Aline decimals
 
Similar Threads
Render my web page in pdf instead that hmtl
DecimalFormat
number formatting
Rounding problem
string to int