Raised This Month: $ Target: $400
 0% 

Float show problem


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 10-17-2011 , 17:09   Float show problem
Reply With Quote #1

PHP Code:
                new Float:iFM iKills[id] / iDeaths[id] + 0.0;
                
ColorChat(idNORMAL"^4[ STATS ]^1 Frags: ^3%d^1 Deaths: ^3%d^1 K:D ratio: ^3%.3f"iKills[id], iDeaths[id], iFM
iKills = 12
iDeaths = 7

but K ratio it shows 1.000 even if it has to be 1.714
reinert is offline
Stereo
Veteran Member
Join Date: Dec 2010
Old 10-17-2011 , 17:26   Re: Float show problem
Reply With Quote #2

Try change with %3.2f


and


PHP Code:
new Float:iFM = (iKills[id] / iDeaths[id] + 0.0); 
Stereo is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 10-17-2011 , 17:30   Re: Float show problem
Reply With Quote #3

Still same.
reinert is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 10-17-2011 , 17:51   Re: Float show problem
Reply With Quote #4

= float(iKills[id]) / float(Deaths[id])
or
= float(iKills[id]) / Deaths[id]
or
= iKills[id] *1.0 / Deaths[id]
__________________
Arkshine is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:00.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode