I have double values like 0.0345333 or 1.0897777 and I want to convert them to 0.034 and 1.089 in Java?
How can I do it?
I want to convert the values, not print them since I need it for calculation.
I find the following way but I am looking for simple way.
double score=(tff* idf);
DecimalFormat df = new DecimalFormat("#.###");
p.score=Double.parseDouble(df.format(score));