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 {
    private static BigDecimal getShareAmount(Double amount, Double rate, Integer installments) {
        return new BigDecimal(amount * ((1 + rate / 100) / installments)).setScale(2, RoundingMode.HALF_UP);
    }
}