Raised This Month: $ Target: $400
 0% 

Mhm %s and %d?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
merkava
Junior Member
Join Date: Jun 2008
Old 05-21-2009 , 13:27   Mhm %s and %d?
Reply With Quote #1

Hello.
I have a horrible problem. I don't know when i must use %s and when use %d.
I think this is funny problem but I rest on you.
merkava is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-21-2009 , 13:29   Re: Mhm %s and %d?
Reply With Quote #2

%s - string
%d - number
%i - integer
%f - float
__________________
xPaw is offline
ot_207
Veteran Member
Join Date: Jan 2008
Location: Romania The Love Country
Old 05-21-2009 , 13:30   Re: Mhm %s and %d?
Reply With Quote #3

And don't forget
%0.2f
Example for: 6.0
%f displays 6.0000000
%0.2f displays 6.00
__________________
My approved plug-ins | Good for newbies! | Problems?

Back, will come around when I have time.
ot_207 is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 05-21-2009 , 13:32   Re: Mhm %s and %d?
Reply With Quote #4

Quote:
Originally Posted by ot_207 View Post
%f displays 6.0000000
only 6 nums after dot ;)
__________________
xPaw is offline
merkava
Junior Member
Join Date: Jun 2008
Old 05-21-2009 , 13:44   Re: Mhm %s and %d?
Reply With Quote #5

Thanks!
merkava is offline
dstopgunner
Senior Member
Join Date: Oct 2007
Old 05-22-2009 , 10:36   Re: Mhm %s and %d?
Reply With Quote #6

whats difference between %i - integer and %d - number ? both numbers =o
dstopgunner is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 05-22-2009 , 10:42   Re: Mhm %s and %d?
Reply With Quote #7

To make a number have 0 'fillers' use %02d

Example: Suppose you have a number, 6, and want it to appear as 06 you can use %02d and for 006, %03d.
__________________
Bugsy is offline
_lol_
Senior Member
Join Date: Apr 2009
Old 05-22-2009 , 12:17   Re: Mhm %s and %d?
Reply With Quote #8

Quote:
Originally Posted by Bugsy View Post
To make a number have 0 'fillers' use %02d

Example: Suppose you have a number, 6, and want it to appear as 06 you can use %02d and for 006, %03d.
nice i didnt know that ^^
__________________
_lol_ 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 01:25.


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