How can I truncate a double to only two decimal places in Java?
If you want that for display purposes, use java.text.DecimalFormat: If you need it for calculations, use java.lang.Math:
If you want that for display purposes, use java.text.DecimalFormat: If you need it for calculations, use java.lang.Math:
If you want that for display purposes, use java.text.DecimalFormat: If you need it for calculations, use java.lang.Math: