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
Try using DecimalFormat and set the RoundingMode to match what you need.