Java Random Number getRandomDouble(double max, String decimalFormat)

Here you can find the source of getRandomDouble(double max, String decimalFormat)

Description

get Random Double

License

Apache License

Declaration

public static double getRandomDouble(double max, String decimalFormat) 

Method Source Code

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

import java.text.DecimalFormat;

public class Main {
    public static double getRandomDouble(double max, String decimalFormat) {
        DecimalFormat formatter = new DecimalFormat(decimalFormat);
        return Double.parseDouble(formatter.format(Math.random() * max));

    }//from   w  w w . j  av  a  2s .c  om
}

Related

  1. getPositiveNumber(int maximum)
  2. getRandNum(int charCount)
  3. getRandNum(int num)
  4. getRandNum(int num)
  5. getRandNumber(int maxNumber)
  6. getRandomNum()
  7. getRandomNum()
  8. getRandomNum()
  9. getRandomNum()