Raised This Month: $32 Target: $400
 8% 

Printing a float to chat...it returns a string of punctiation?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
CShadowRun
Junior Member
Join Date: Jul 2007
Old 11-02-2007 , 23:29   Printing a float to chat...it returns a string of punctiation?
Reply With Quote #1

Code:
PrintToChat(client,"You are level %d with %f exp",CSRRPG_exptolevel(CSRRPG_exp[client]),CSRRPG_exp[client]);

public CSRRPG_exptolevel(Float:exp)
{
    return RoundToFloor(Pow(((2*exp)/CSRRPG_EXPINC)+0.25,0.5)+0.5);
}
CSRRPG_exp[client] == 62498750000

This prints to chat "You are level 50000 with ./,),(-*,(.(((((( exp"
...Whats up with that?
CShadowRun is offline
CShadowRun
Junior Member
Join Date: Jul 2007
Old 11-03-2007 , 00:34   Re: Printing a float to chat...it returns a string of punctiation?
Reply With Quote #2

Upon further investigation i've noticed this is something to do with large numbers, and as floating point numbers behave strangely at large values, i've decided to scrap my large values idea and do it all a diffrent way
CShadowRun is offline
sslice
Senior Member
Join Date: Feb 2005
Location: Texas, USA
Old 11-07-2007 , 13:10   Re: Printing a float to chat...it returns a string of punctiation?
Reply With Quote #3

This is most likely a bug with SourceMod's proprietary Format function.
__________________
sslice is offline
BAILOPAN
Join Date: Jan 2004
Old 11-07-2007 , 15:29   Re: Printing a float to chat...it returns a string of punctiation?
Reply With Quote #4

Please file a bug report, I recall seeing that before in AMX Mod X.
__________________
egg
BAILOPAN is offline
Reply


Thread Tools
Display Modes

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 19:30.


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