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.
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.
http://java.sun.com/docs/books/tutorial/i18n/format/numberFormat.html
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
java.io.PrintStream.printf (....); // Exactly what you want.
But, turn to Tiger (JSE5.0); // Reasons enough to do so.
;JOOP!
But, turn to Tiger (JSE5.0); // Reasons enough to do so.
;JOOP!
What is wrong with JAVA's .printf() ?
;JOOP!
;JOOP!
Nothing :)