Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.math.BigDecimal;

public class Main {

    public static double add(double v1, double v2) {
        BigDecimal a = new BigDecimal(v1);
        BigDecimal b = new BigDecimal(v2);
        BigDecimal c = a.add(b);
        return c.setScale(2, BigDecimal.ROUND_HALF_UP).doubleValue();
    }
}