• Source
    1. public class Main {
    2. public static void main(String[] args) {
    3. double total = 46.565;
    4. double roundtotal = Math.round(total * 100.0) / 100.0;
    5. System.out.println(total +" rounded to 2 places is "+roundtotal);
    6. }
    7. }