Finding Accuracy Of Two Values

I’m trying to make accuracy by taking the amount of correct moves and the amount of attempted moves, I searched it up online and found the formula for it (correctMoves.Value * 100 / AttemptedMoves.Value) and that did not work.

Please help!

Thanks in advance

2 Likes

Might be AttemptedMoves.Value * 100 / correctMoves.Value

(This would be a percentage, like 100%, 90%, etc.)

1 Like

If AttemptedMoves don’t get higher than CorrectMoves then your formula would look like this:

correctMoves.Value / 100 * AttemptedMoves.Value
1 Like

The math is incorrect, how it works is that you got the hit amount, and the total amount of hits, you divide the hit amount by the total amount of hits and it gives you a range between 0 and 1, you then multiply that by a 100 to then give you a 0 to 100 range

Math:
(hitAmount.Value / totalHits.Value) * 100

Example:
You’ve got 50 correct hits out of 100 hits
(50 / 100) * 100
Now 50 divided by a hundred is equal to 0.5, when you multiply that by 100, you get 50.

I’ve said hits instead of moves because i thought this was for a shooter game, but dw, it works the same way

That formula is correct, so what are you trying to do? Given two inputs, what do you want the output to look like?

CurrentLine = CorrectMoves
Moves = AttemptedMoves

The formula that I originally used did not work

Tell me what these values are equal to, because i am 100% sure that the formula is correct, i even gave an example

Correct Moves = 250
AttemptedMoves = 255

Did you print them or did you just say what you expect them to be?

I went into the game and changed the values then printed, By the server

1 Like

Just print them so you can make sure they are what you expect, plus use a calculator, (250 / 255) * 100 is equal to 98.03

So what happend was when the game ended I set the moves back to 1 and the messed it up, thanks for help

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.