Here you can find the source of getRandomBigDecimal(BigDecimal a, BigDecimal b)
public static BigDecimal getRandomBigDecimal(BigDecimal a, BigDecimal b)
//package com.java2s; //License from project: Open Source License import java.math.BigDecimal; public class Main { public static BigDecimal getRandomBigDecimal(BigDecimal a, BigDecimal b) { double randomNum = Math.random(); return a.add((b.subtract(a)).multiply(new BigDecimal(randomNum))); }//from w w w .j a va2s . c o m }