Java BigDecimal randomBigDecimal()

Here you can find the source of randomBigDecimal()

Description

random Big Decimal

License

Apache License

Declaration

public static BigDecimal randomBigDecimal() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.math.BigDecimal;

import java.util.Random;

public class Main {
    private static Random sRandom = new Random();

    public static BigDecimal randomBigDecimal() {
        return BigDecimal.valueOf(randomdouble());
    }/*  w w w.  java  2s .  c  o  m*/

    public static double randomdouble() {
        return sRandom.nextDouble();
    }

    public static Double randomDouble() {
        return Double.valueOf(randomdouble());
    }
}

Related

  1. percentOf(BigDecimal fullAmount, int percentToKeep)
  2. percentToFactor(BigDecimal percent)
  3. printBigDecimal(BigDecimal decimal)
  4. printGainHTML(BigDecimal gain)
  5. putBigDecimal(byte[] bytes, int offset, BigDecimal val)
  6. randomBigDecimalList(BigDecimal min, BigDecimal max, int minLength, int maxLength)
  7. rangedValue(BigDecimal lower, BigDecimal upper, Random random)
  8. readBigDecimal(byte valueBytes[], int valueLength, int scale)
  9. readBigDecimal(DataInput in)