Q:

Result with 2 digits after . eg:23.65

I want to do some calculations on my app the result will mostly have from 5 to 15 digits after the . for example 24.61835496354822 I want to display the result in a TextView and only show 2 digits after . for example 24.61 please help me

A:

double d = 24.61835496354822;
DecimalFormat f = new DecimalFormat("##.00");
System.out.println(f.format(d));

