Java BigDecimal getRandomBigDecimal(BigDecimal a, BigDecimal b)

Here you can find the source of getRandomBigDecimal(BigDecimal a, BigDecimal b)

Description

get Random Big Decimal

License

Open Source License

Declaration

public static BigDecimal getRandomBigDecimal(BigDecimal a, BigDecimal b) 

Method Source Code


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

Related

  1. getPercent(BigDecimal numerator, BigDecimal denominator)
  2. getPercentage(BigDecimal amount, BigDecimal percent)
  3. getPercentageValue(BigDecimal price, double amount)
  4. getProfit(BigDecimal ask, BigDecimal bid, BigDecimal fee)
  5. getProzentWert(BigDecimal zahl, BigDecimal prozentsatz, int nachkommastellen)
  6. getRandomBigDecimal(int maxValue, int scale)
  7. getRandomPriceChangeFactor(BigDecimal currentPrice)
  8. getRecordSize(List> columnBaseData)
  9. getRSBigDecimal(Object object)