Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Math help needed!

  1. #1
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51

    Math help needed!

    I'm using this formula in some code i'm writing to get the percent of a number

    Percent = ((( X ) / 272) * 100)-10)


    This formula works. But i need a second formula that solves for x using the same constants... and adding a percent as a constant

    so lets say for example percent = 50.. how would i figure out what the heck x is lol.

    I knew i shouldnt have copied from the smart chick in math class
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  2. #2
    Low Bitrate JackB's Avatar
    Join Date
    Aug 2006
    Location
    Kirkland, Washington, United States
    Posts
    73
    I'm not exactly sure why you're offsetting the percentage by 10...

    Usually this is the formula:

    % = ( X / TotalItems) * 100

    If we solve for X, we get:

    X = (% * TotalItems) / 100

    So, your formula would be:

    X = (Percent + 10) * 272 / 100

    Is that what you're looking for?

  3. #3
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    Quote Originally Posted by JackB View Post
    I'm not exactly sure why you're offsetting the percentage by 10...

    Usually this is the formula:

    % = ( X / TotalItems) * 100

    If we solve for X, we get:

    X = (% * TotalItems) / 100

    So, your formula would be:

    X = (Percent + 10) * 272 / 100

    Is that what you're looking for?
    i'm offsetting because the slider is offset by 10. I'll try the formula and let you know the results
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  4. #4
    FLAC
    Join Date
    May 2006
    Location
    Calgary, Alberta
    Posts
    1,718
    Math homework?

    Just change the signs as you bring the numbers across the equals sign.
    Percent = ((( X ) / 272) * 100)-10)
    Percent + 10 = ((x) / 272) * 100)
    Percent + 10 = 100x / 272
    272 * (Percent + 10) = 100x
    272/100 * (Percent + 10) = x
    2.72 * (Percent + 10) = x
    Ampie Case
    2.5" Hard Drive 80GB Samsung 5400RPM
    256 MB DDR2 PC5400
    Xenarc 700TSV - VGA Monitor
    Intel D945GCLF Motherboard
    M2-ATX-HV

    2005 Honda Civic

  5. #5
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    Quote Originally Posted by Maheriano View Post
    Math homework?

    Just change the signs as you bring the numbers across the equals sign.
    Percent = ((( X ) / 272) * 100)-10)
    Percent + 10 = ((x) / 272) * 100)
    Percent + 10 = 100x / 272
    272 * (Percent + 10) = 100x
    272/100 * (Percent + 10) = x
    2.72 * (Percent + 10) = x
    Nah not homework.. skin work..and it works! Thanks guys.. had been rattling my brain on that for some time.
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  6. #6
    Low Bitrate JackB's Avatar
    Join Date
    Aug 2006
    Location
    Kirkland, Washington, United States
    Posts
    73
    Yeah, Maheriano... That's what I said, (basically).

    The 272/100 will be compiled out.

    I enjoy math. Does that make me sick?

  7. #7
    FLAC Machinehead's Avatar
    Join Date
    Jun 2007
    Location
    hijacks small portable city
    Posts
    1,381
    Quote Originally Posted by JackB View Post
    Yeah, Maheriano... That's what I said, (basically).

    The 272/100 will be compiled out.

    I enjoy math. Does that make me sick?
    A sadist maybe. I don't know, I do math all day long at work.

  8. #8
    FLAC
    Join Date
    May 2006
    Location
    Calgary, Alberta
    Posts
    1,718
    Quote Originally Posted by JackB View Post
    Yeah, Maheriano... That's what I said, (basically).

    The 272/100 will be compiled out.

    I enjoy math. Does that make me sick?
    Great minds think alike! I did it out for him though, so hopefully he'll understand how it works for next time.
    Ampie Case
    2.5" Hard Drive 80GB Samsung 5400RPM
    256 MB DDR2 PC5400
    Xenarc 700TSV - VGA Monitor
    Intel D945GCLF Motherboard
    M2-ATX-HV

    2005 Honda Civic

  9. #9
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,151
    Blog Entries
    51
    probably not but at least ill know where to search
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  10. #10
    Low Bitrate JackB's Avatar
    Join Date
    Aug 2006
    Location
    Kirkland, Washington, United States
    Posts
    73
    Quote Originally Posted by Machinehead View Post
    A sadist maybe. I don't know, I do math all day long at work.
    Yeah. I write code all day at work. That is almost like doing math.

Page 1 of 2 12 LastLast

Similar Threads

  1. New Car PC info needed
    By Tribalvision in forum Newbie
    Replies: 1
    Last Post: 01-06-2008, 09:00 PM
  2. Needed, Last few Norwegian translations needed
    By veetid in forum Centrafuse
    Replies: 1
    Last Post: 06-13-2007, 10:55 AM
  3. Amplifier Needed?
    By c0rrupti0n in forum Newbie
    Replies: 7
    Last Post: 03-15-2004, 03:04 AM
  4. Sony LCD tv part needed!
    By mp3hombre in forum General MP3Car Discussion
    Replies: 2
    Last Post: 02-03-2003, 12:15 PM
  5. My project for the day - advice needed
    By ddt in forum General MP3Car Discussion
    Replies: 2
    Last Post: 12-02-2002, 07:51 AM

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
  •