java - Formatting Double with two dp -
from decimalform method below, want convert double value 7777.54 7 777,54 getting 7 777 54. have missed ? result should 7 777,54
public static string decimalform(double value){ decimalformat df = new decimalformat("#,###,###.00"); string formatted_value = df.format(value).replaceall(",", " ").replace(".", ","); return formatted_value; }
this works me:
decimalformat df = new decimalformat("#,###,###.00"); string formatted_value = df.format(value).replaceall("\\.", " ");
in fact tried print out df.format(value)
and, value=95871
got 95.871,00
Comments
Post a Comment