Raised This Month: $ Target: $400
 0% 

Strings, and displaying


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-09-2004 , 18:20   Strings, and displaying
Reply With Quote #1

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
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-09-2004 , 19:59  
Reply With Quote #2

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
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
devicenull
Veteran Member
Join Date: Mar 2004
Location: CT
Old 07-10-2004 , 00:29  
Reply With Quote #3

The decimals confused me too
__________________
Various bits of semi-useful code in a bunch of languages: http://code.devicenull.org/
devicenull is offline
jtp10181
Veteran Member
Join Date: May 2004
Location: Madison, WI
Old 07-10-2004 , 11:15  
Reply With Quote #4

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.
__________________
jtp10181 is offline
Send a message via ICQ to jtp10181 Send a message via AIM to jtp10181 Send a message via MSN to jtp10181 Send a message via Yahoo to jtp10181
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 14:50.


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