How to expand a fraction to 100 as the denominator.

137 Views Asked by At

I'm working with some code that calculates point values based on computer hardware.

On one computer as an example, the computer ends up with 29 possible points.

Now lets say that I run the same code on another computer, and it tries to match hardware to the previously entered information from the computer with 29 points.

Say this computers hardware points match 7 points of the previously entered data.

Thus effectively, this computer is a ~24% match to the previously entered hardware data. (7/29)

Now, what I want to do is expand this fraction (7/29) so that the maximum amount of points is 100, but I am having trouble coming up with a formula for this that works no matter what the max points for the computer are. (Some computers can have more or less maximum points)

So basically I want to expand the fraction to x/100 from 7/29

I'm not really sure if this is possible or not, but I want to do this to allow it to be easier to understand on the surface of the software I am using, so that every computer has a maximum of 100 points based on whatever the original points are.