I have some calculation like this
public class Florida {
public static void main(String arg[]){
double value = 9223372036854775807l;
double ans = 0;
ans = ans + value * 2.00 /1000;
System.out.println("Hello : "+ans);
}
}
but I am getting answer like this
Hello : 1.8446744073709552E16
and I need in simple digit format.
Use
printf()with%f:You can change the number of significant digits by tweaking the format specifier; for example, the following will just print out the integer part: