PHP ratio help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: PHP ratio help (
/showthread.php?tid=485996)
PHP ratio help -
Champ - 06.01.2014
Код:
$a = "$GetPlayerKills";
$b = "$GetPlayerDeaths";
$total = $a / $b;
I want it to be " 1.99 " not " 1.99999999 "
any idea ?
Re: PHP ratio help -
Tayab - 06.01.2014
Try this after defining $total variable.
PHP код:
echo round($total, 1, PHP_ROUND_HALF_UP);