Java tutorial
//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); } }