AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Strings, and displaying (https://forums.alliedmods.net/showthread.php?t=3555)

devicenull 07-09-2004 18:20

Strings, and displaying
 
Ok, so I want to display stuff in near columns.. I see how its done in amx_who.. but what do the decimal numbers mean?
Code:
 console_print(id,"^nClients on server:^n #  %-16.15s %-12s %-8s %-4.3s %-4.3s %s", "nick","authid","userid","imm","res","access")
I could see if they were whole numbers, but what the hell do they mean? I know basically what they do (make that variable fit in a certain number of spaces) but I can't find where I found that out

jtp10181 07-09-2004 19:59

good question..... I belive this is the same (or similar) as perls printf

but.... the decimals are supposed ot be for... decimals. I have no idea whats going on there.

normally the numbers would just be used to pad the output.

http://secu.zzu.edu.cn/book/Perl/Per...rl/ch06_05.htm

devicenull 07-10-2004 00:29

The decimals confused me too

jtp10181 07-10-2004 11:15

I never use decimals when making formatted output and it comes out fine for me... I'd say to just ignore them I think they are supposed to be used with %f to set the number of decimal places displayed.


All times are GMT -4. The time now is 14:50.

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