vinnymac / PokeNurse

💉 A tool for Pokémon Go to aid in transferring and evolving Pokémon
284 stars 48 forks source link

Finer grain IV (reopened) #93

Closed SteinerKD closed 8 years ago

SteinerKD commented 8 years ago

OK, been in contact with the Pogobuf creator and he suggested a slight change of code to get the decimal value return on IV values. This is what he said.

Take this code from line 233

var percent = (att + def + stam) / 45 * 100;

And change to:

var percent = Math.round((att + def + stam) / 45 * 10000) / 100;

For me as a mathematician it makes no sense as the output would be the same, but I guess the math.round function is the key here.

Looking around at other tools one decimal IV values is definitely the norm used everywhere, so would be nice for better comparison.

mackhankins commented 8 years ago
screen shot 2016-08-13 at 8 26 42 am

I think I'd rather have just one decimal, but that's the results of the above.

SteinerKD commented 8 years ago

Wild guess, multiply by 1000 and divide by 10 instead? I agree, a single decimal is preferred. Maybe the docs for Math.round have a clue?

mackhankins commented 8 years ago

Final result is 93.3%. Tested and merged.

SteinerKD commented 8 years ago

Awesome! Thank you.