Page 1 of 1

A little help with a math issue

PostPosted: Sun Jun 14, 2015 6:18 pm
by RBuster
I need to calculate a value and I found some difficulty to create the right equation.

I would like to know the percent of the precision of clicks.

I have the number of the player's clicks and the number of hits. I believe that's correct if I divide them and multiply by 100, including &"%" after, isn't? I tried to use "round" to eliminate decimal numbers, but I didn't get the correct value?

Other doubt: How can I do to prevent "NaN (if player doesn't click in the screen)?

Thanks in advance

Re: A little help with a math issue

PostPosted: Sun Jun 14, 2015 6:53 pm
by Colludium
If Click_No > 0
-- PrecisionVar = int(100 * Hit_No / Click_No) & "%"

Re: A little help with a math issue

PostPosted: Sun Jun 14, 2015 7:28 pm
by RBuster
The right way. Thank you, @Colludium

Re: A little help with a math issue

PostPosted: Sun Jun 14, 2015 8:25 pm
by Colludium
Any time :). Sometimes I have to leave my self-made problems for a day before I can return and try again.