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
Check java.math.BigDecimal.round(MathContext).
java.math.BigDecimal.round(MathContext).