# Thread: Math help needed!

1. ## 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

2. 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. Originally Posted by JackB
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

4. 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

5. Originally Posted by Maheriano
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.

6. Yeah, Maheriano... That's what I said, (basically).

The 272/100 will be compiled out.

I enjoy math. Does that make me sick?

7. Originally Posted by JackB
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. Originally Posted by JackB
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.

9. probably not but at least ill know where to search

10. Originally Posted by Machinehead
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 Last

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•