Here you can find the source of decimal_random()
public static String decimal_random()
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { public static String decimal_random() { String valor_retorno = new String(""); int[] ndigitos = new int[10]; int n;/* w ww . j a v a 2s . co m*/ Random rnd = new Random(); for (int i = 0; i < 10; i++) ndigitos[i] = 0; for (long i = 0; i < 100000L; i++) { n = (int) (rnd.nextDouble() * 10.0); ndigitos[n]++; } rnd.setSeed(new Date().getTime()); valor_retorno = Double.toString(rnd.nextDouble()); return valor_retorno; } }