Multiple of 100


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Multiple of 100

  1. #1
    Join Date
    Oct 2005
    Posts
    2

    Multiple of 100

    All i'm trying to do is create a random number between 100-3000 that's a multiple of 100...

    randomNum = 100+(int)(Math.random()*2900);

    I know this creates a number between 100-3000, any ideas on how to make the number it creates a multiple of 100?

  2. #2
    Join Date
    Sep 2005
    Location
    istanbul / Turkey
    Posts
    133
    create a random multiplier between [1,30]
    and multiply it with 100.

Similar Threads

  1. Replies: 1
    Last Post: 02-12-2005, 05:43 PM
  2. pleeese help me i am sooo stuck
    By christopher in forum Java
    Replies: 4
    Last Post: 12-19-2002, 01:31 PM
  3. Router with Multiple IPs
    By Brian H in forum Web
    Replies: 0
    Last Post: 01-17-2002, 02:42 PM
  4. Displaying XML Data using .Net Controls
    By Greg Rothlander in forum ASP.NET
    Replies: 1
    Last Post: 11-27-2001, 07:09 PM
  5. Multiple Bests for different categories
    By r dower in forum Database
    Replies: 7
    Last Post: 03-31-2000, 01:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center