Elite Diviner
- Joined
- Dec 23, 2008
- Messages
- 425
- Reaction score
- 15
What's the formula to change the Catch rate (For example: 45 for bulbasaur) to 5.9%?
Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!
Join Today!This is for the pokemon-arena browser game, there's a table only with the catch rate (example:45) and not with the %for any specific source? some of these sources have catch rate included in the encounter rate.
$result = mysql_query("SELECT wild_id, vangbaarheid FROM pokemon_wild WHERE wild_id='".$_GET['pokemon']."'");
$szamok = mysql_fetch_assoc($result);
$egesz = 765.7657657657659;
$egy = $egesz/100;
$kerdeses_szam = $szamok['vangbaarheid'];
$eredmeny = $kerdeses_szam/$egy;
number_format($eredmeny, 2, '.', '');
$a = $eredmeny;
$b = 50;
$felkerekites = ceil($a*$b)/$b;
echo "Success catch rate: ".number_format($felkerekites, 1, '.', '')."%</br>";
This is for the pokemon-arena browser game, there's a table only with the catch rate (example:45) and not with the %
so I'm making a new pokedex that will show the %, but I can't find how to do so..
echo "Success catch rate: ".number_format($felkerekites, 1, '.', '')."%</br>";
Thanks I saw that you gave me it in skype it works perfectlyCode:$result = mysql_query("SELECT wild_id, vangbaarheid FROM pokemon_wild WHERE wild_id='".$_GET['pokemon']."'"); $szamok = mysql_fetch_assoc($result); $egesz = 765.7657657657659; $egy = $egesz/100; $kerdeses_szam = $szamok['vangbaarheid']; $eredmeny = $kerdeses_szam/$egy; number_format($eredmeny, 2, '.', ''); $a = $eredmeny; $b = 50; $felkerekites = ceil($a*$b)/$b; echo "Success catch rate: ".number_format($felkerekites, 1, '.', '')."%</br>";
So... jsut add the % in with a string, just like Kiru's code:
see the % before the <br>?Code:echo "Success catch rate: ".number_format($felkerekites, 1, '.', '')."%</br>";