Get the tools you need to learn Java skills fast!
Video tutorials, eBooks, hands-on lab exercises, sample code.
Get started
The moose likes Java in General and the fly likes number formating Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of The Software Craftsman this week in the Agile forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "number formating" Watch "number formating" New topic

number formating

Benjamin Samuel
Ranch Hand

Joined: Dec 15, 2006
Posts: 33
I'm having a double value
e.g. a)99558669546.

I have to convert these values into String. I need to read the value as-is without any truncation or formatting. For E.g. i do not want 'a'
to be formatted in Exponential format (like E9) and i dont want 'b' to be truncated to 0.001 while converting to String.

How can I achieve this using NumberFormat class or is there any other class through which this can be achieved?
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42954
Please do not post the same question to multiple forums. Read this for why I deleted the other copies of your post.
Bill Shirley
Ranch Hand

Joined: Nov 08, 2007
Posts: 457
You didn't give us an example of how you want to use this as a string.

Try the docs for System.out.printf().

Bill Shirley - bshirley -
if (Posts < 30) JavaRanchFAQ);
Have you tried LearnNowOnline?
subject: number formating