Java BigDecimal percentOf(BigDecimal fullAmount, int percentToKeep)

Here you can find the source of percentOf(BigDecimal fullAmount, int percentToKeep)

Description

percent Of

License

Apache License

Declaration

public static BigDecimal percentOf(BigDecimal fullAmount, int percentToKeep) 

Method Source Code


//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
}

Related

  1. objToBigDecimal(Object obj)
  2. PackUnit2Uom(BigDecimal packUit, String eachUnitName)
  3. percent0(final BigDecimal c, final BigDecimal percent)
  4. percentage(BigDecimal bd)
  5. percentChange(BigDecimal oldValue, BigDecimal newValue)
  6. percentToFactor(BigDecimal percent)
  7. printBigDecimal(BigDecimal decimal)
  8. printGainHTML(BigDecimal gain)
  9. putBigDecimal(byte[] bytes, int offset, BigDecimal val)