• Fajer Naqeeb
  • NEWBIE
  • 0 Points
  • Member since 2019
  • Application support Analyst
  • Rasmala Investments Bank Limited

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies
hello friends,
   I m using following code to ganarate 6 digit random number.but it creates 4-6 digit random number(eg. like 4567,98765,341235,...).But i need 6 digit random numbers only.how to solve this.
Integer index=0;  
    public Integer getindex()
   {
      double y = Math.random() ;//something between 0 and 999999  
      y = 999999 * y;
      index = math.round(y); 
    return index;
    }