Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class Main {
    public static BigDecimal redondear(double f, int scale) {
        String val = f + "";
        BigDecimal big = new BigDecimal(val);
        big = big.setScale(scale, RoundingMode.HALF_UP);

        return big;
    }
}