Here you can find the source of calculatePercentChange(BigDecimal from, BigDecimal to)
public static BigDecimal calculatePercentChange(BigDecimal from, BigDecimal to)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; import java.math.RoundingMode; public class Main { private static final BigDecimal CENT = new BigDecimal(100); public static BigDecimal calculatePercentChange(BigDecimal from, BigDecimal to) { BigDecimal difference = to.subtract(from); return difference.divide(from, 8, RoundingMode.HALF_UP).multiply(CENT); }//from ww w . j ava2 s . c o m }