I get an float number as output from an method i want to round it to 7 significant digits.For ex:
if 1.234 output should be 1.234000
if 7.1232478 output should be 7.123248
I tried
sum=sum*1000000/1000000;
System.out.println(Float.toString(sum).substring(0,8));
Is there any better way to do this?