Killer Posted September 23, 2007 Share Posted September 23, 2007 Hi, Anyone knows how to set number vars to show 2 or more zeros? Example $num=001 instead of $num=1 Link to comment Share on other sites More sharing options...
GaryFrost Posted September 23, 2007 Share Posted September 23, 2007 Hi, Anyone knows how to set number vars to show 2 or more zeros? Example $num=001 instead of $num=1 do it as a string for example $num = StringFormat("%03d", 1) SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
Killer Posted September 24, 2007 Author Share Posted September 24, 2007 do it as a string for example $num = StringFormat("%03d", 1) Doesn't work for me. Link to comment Share on other sites More sharing options...
Moderators SmOke_N Posted September 24, 2007 Moderators Share Posted September 24, 2007 Doesn't work for me.Um... why not? What version of AutoIt are you using... this function has been around for quite some time, and it works fine for me.For $iCC = 1 To 99 ConsoleWrite(StringFormat("%03d", $iCC) & @CRLF) Next Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer. Link to comment Share on other sites More sharing options...
Killer Posted September 24, 2007 Author Share Posted September 24, 2007 (edited) Um... why not? What version of AutoIt are you using... this function has been around for quite some time, and it works fine for me.For $iCC = 1 To 99 ConsoleWrite(StringFormat("%03d", $iCC) & @CRLF) Next I am actually trying to do this. It will show a list of numbers. I want them in 2 digits. But in this case only 10 is 2 digit which is logical. Hope you get a clearer picture. Anyway I over came this problem using a if else for 1 to 9 to add a extra 0 in string format. Thanks for responding. $x=0 $list="" do $x=$x+1 $list=$list&$x&chr(10) until $x=10 msgbox(0,"list",$list) Edited September 24, 2007 by Killer Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now