Java Random Number getNum(int length)

Here you can find the source of getNum(int length)

Description

get Num

License

Apache License

Declaration

public static String getNum(int length) 

Method Source Code

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

import java.util.Random;

public class Main {

    public static String getNum(int length) {
        Random rm = new Random();
        int pross = (int) (rm.nextDouble() * Math.pow(10, length));
        return String.format("%0" + length + "d", pross);
    }// w ww . j  a  v  a  2  s.co m
}

Related

  1. genRandomNumList(int num, int count)
  2. getChance(Number number)
  3. getDocumentNumber()
  4. getFlightNumber()
  5. getNextRandomNumber()
  6. getNumAndWord(int length)
  7. getNumber()
  8. getNumber()
  9. getNumber(int _nX0, int _nX1)