AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Mhm %s and %d? (https://forums.alliedmods.net/showthread.php?t=92881)

merkava 05-21-2009 13:27

Mhm %s and %d?
 
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.

xPaw 05-21-2009 13:29

Re: Mhm %s and %d?
 
%s - string
%d - number
%i - integer
%f - float

ot_207 05-21-2009 13:30

Re: Mhm %s and %d?
 
And don't forget
%0.2f :)
Example for: 6.0
%f displays 6.0000000
%0.2f displays 6.00

xPaw 05-21-2009 13:32

Re: Mhm %s and %d?
 
Quote:

Originally Posted by ot_207 (Post 831787)
%f displays 6.0000000

only 6 nums after dot ;)

merkava 05-21-2009 13:44

Re: Mhm %s and %d?
 
Thanks!

dstopgunner 05-22-2009 10:36

Re: Mhm %s and %d?
 
whats difference between %i - integer and %d - number ? both numbers =o

Bugsy 05-22-2009 10:42

Re: Mhm %s and %d?
 
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.

_lol_ 05-22-2009 12:17

Re: Mhm %s and %d?
 
Quote:

Originally Posted by Bugsy (Post 832427)
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 ^^


All times are GMT -4. The time now is 01:25.

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