Java tutorial
//package com.java2s; import java.math.BigDecimal; public class Main { public static double mul(double v1, double v2) { BigDecimal a = new BigDecimal(v1); BigDecimal b = new BigDecimal(v2); BigDecimal c = a.multiply(b); return c.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue(); } }