DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

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

Bookmarks

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


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links