Here you can find the source of percentOf(BigDecimal fullAmount, int percentToKeep)
public static BigDecimal percentOf(BigDecimal fullAmount, int percentToKeep)
//package com.java2s; //License from project: Apache License import java.math.BigDecimal; public class Main { public static BigDecimal percentOf(BigDecimal fullAmount, int percentToKeep) { return fullAmount.divide(new BigDecimal("100.00")).multiply(new BigDecimal(percentToKeep)).setScale(2); }//from ww w.j av a2s .c om }