For example I have the variable 3.545555555, which I would want to truncate to just 3.54. Answer If you want that for display purposes, use java.text.DecimalFormat: If you need it for calculations, use java.lang.Math:
For example I have the variable 3.545555555, which I would want to truncate to just 3.54. Answer If you want that for display purposes, use java.text.DecimalFormat: If you need it for calculations, use java.lang.Math: