Search This Blog

Thursday, October 4, 2012

passing the Double values to the String

result = number1/number2
String stringdouble= Double.toString(result);

or you can use the nuberformate also.

Double result = number1/number2;
NumberFormat nm = NumberFormat.getNumberInstance();

For 3 decimal digit
private static DecimalFormat REAL_FORMATTER = new DecimalFormat("0.###");

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.