Link to home
Start Free TrialLog in
Avatar of sumantedla
sumantedla

asked on

how to format a double value

Hi,

I was wondering whether there is any format function in java like printf in "C" .

 what is the easiest way of formatting a double. I want to have only n numbers after the decimal point.
Avatar of venkateshwarr
venkateshwarr

ASKER CERTIFIED SOLUTION
Avatar of venkateshwarr
venkateshwarr

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
java.io.PrintStream.printf(....);     // Exactly what you want.

But, turn to Tiger (JSE5.0); // Reasons enough to do so.

;JOOP!
What is wrong with JAVA's .printf() ?

;JOOP!
Nothing :)