Raised This Month: $ Target: $400
 0% 

Add Leading Zero


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Mlk27
Veteran Member
Join Date: May 2008
Old 02-20-2009 , 22:28   Add Leading Zero
Reply With Quote #1

Any idea how to add leading zero if an integer has only 1 digit

Code:
public Check_Uptime() {     new Float:ft = Float:engfunc(EngFunc_Time)     new it = floatround(ft)     new s = it % 60;     new m = (it / 60) % 60     new h = (it / 3600) % 24     new d = it / 86400     format(Curr_Uptime, 16, "%i:%i:%i:%i", d, h, m, s)     set_cvar_string("Current_Uptime", Curr_Uptime) }

Current_Uptime : 9:9:9 => 09:03:09:09
Mlk27 is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-20-2009 , 22:34   Re: Add Leading Zero
Reply With Quote #2

I believe %02i will work for you
__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Mlk27
Veteran Member
Join Date: May 2008
Old 02-21-2009 , 01:00   Re: Add Leading Zero
Reply With Quote #3

yeah that works..thanks
Mlk27 is offline
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 17:04.


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