This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

accuaracy and effiency float


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Amonel
Senior Member
Join Date: May 2009
Old 11-02-2010 , 08:32   accuaracy and effiency float
Reply With Quote #1

PHP Code:
Float:accuracy(izStats[8])
{
    if (!
izStats[4])
    {
        return (
0.0);
    }

    return (
100.0 float(izStats[5]) / float(izStats[4]));
}

Float:effec(izStats[8])
{
    if (!
izStats[0])
    {
        return (
0.0);
    }

    return (
100.0 float(izStats[0]) / float(izStats[0] + izStats[1]));
}
        
iLen += format(sBuffer[iLen], 2047 iLen"%2d <font color=#07fcff>%-22.22s</font> %6d %6d %4d %3.0f%% %3.0f%% %4d h ^n"1t_sNameizStats[0], izStats[1], izStats[2], effec(izStats), accuracy(izStats), ((iCurTime iTotalTime
%3.0f%%
It will show for example 17.% instead of 17.56%, how can i fix that ?
Amonel is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 11-02-2010 , 09:02   Re: accuaracy and effiency float
Reply With Quote #2

Try : %.3f%%
__________________
Arkshine is offline
Amonel
Senior Member
Join Date: May 2009
Old 11-02-2010 , 10:47   Re: accuaracy and effiency float
Reply With Quote #3

it will show will 3 decimals "17.567%", can you make it for 2 ?

thx again ^^
Amonel is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 11-02-2010 , 11:10   Re: accuaracy and effiency float
Reply With Quote #4

%.2f%%

That was obvious, right?
__________________
xPaw is offline
Amonel
Senior Member
Join Date: May 2009
Old 11-02-2010 , 11:33   Re: accuaracy and effiency float
Reply With Quote #5

and i suppose for 1 decimal %.1f%% and for 0 .. ?
Amonel is offline
issen1
Member
Join Date: Jan 2010
Old 11-02-2010 , 13:13   Re: accuaracy and effiency float
Reply With Quote #6

Look into the documentation. It's all there.
__________________
greets (:
issen1 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 11:07.


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