Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

public class Main {

    public static double round(double value, int scale, int roundingMode) {

        BigDecimal bd = new BigDecimal(value);

        bd = bd.setScale(scale, roundingMode);

        double d = bd.doubleValue();

        bd = null;

        return d;

    }
}