I want to truncate a float and a double value in java.
Following are my requirements: 1. if i have 12.49688f, it should be printed as 12.49 without rounding off 2
double d = ; System.out.println(String.format("%.2f", d - 0.005);