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

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -