DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Need Help With Percentage Formula

  1. #1
    Join Date
    Dec 2003
    Posts
    83

    Need Help With Percentage Formula

    I've been messing around with a little game app in VB.NET and have run into something that seems simple but has me baffled. Here is my problem:

    I need to generate 5000 dots of which 50% of them are white, 20% are green, 10% are blue and 10% are red, and 10% are yellow.

    I can generate the dots with ease but the percentage formula has me stumped. I've always sucked at percentages

    Any math wiz here that can show me how to get the right ratio of colored dots?

  2. #2
    Join Date
    Dec 2003
    Posts
    83
    Nevermind. I decided to go about it a little simpler by just coding in the specific number of each set of dots based on their precentages. I feel kinda silly I didn't think of it before. It's late and I don't drink but I'll blame it on that anyway!

  3. #3
    Join Date
    Feb 2004
    Location
    Longueuil, Québec
    Posts
    577
    5000 * 50 / 100
    5000 * 20 / 100
    5000 * 10 / 100
    5000 * 10 / 100
    5000 * 5 / 100
    Jacques Bourgeois
    JBFI
    http://www3.sympatico.ca/jbfi/homeus.htm

Similar Threads

  1. Replies: 2
    Last Post: 05-12-2009, 05:04 PM
  2. Formula for remaining download time
    By Angelo88 in forum VB Classic
    Replies: 4
    Last Post: 05-24-2007, 05:04 PM
  3. Replies: 2
    Last Post: 01-07-2007, 02:36 PM
  4. Error in Selection Formula (plz Help)
    By AkashAkash in forum VB Classic
    Replies: 3
    Last Post: 07-19-2005, 02:45 PM
  5. simple formula
    By Al Guten in forum .NET
    Replies: 2
    Last Post: 03-19-2003, 11:14 AM

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