Jump to content
Sign in to follow this  
gameshow

Display integers as 2 digits?

Recommended Posts

gameshow

I would like to put some integers in a message box, from variables. The integers will never be greater than 2 digits, but if they are a single digit number, i'd like to display the leading 0. Is this possible?

Share this post


Link to post
Share on other sites
FuryCell

I would like to put some integers in a message box, from variables.  The integers will never be greater than 2 digits, but if they are a single digit number, i'd like to display the leading 0.  Is this possible?

<{POST_SNAPBACK}>

You could use this:

http://www.autoitscript.com/forum/index.php?showtopic=12979

Note: You could also use StringFormat but i think the func I made is easier to use.

Edit:Just saw GaFrosts Post. It seems StringFormat isn't so hard to use after all. :">

Edited by SolidSnake

HKTunes:Softpedia | GoogleCodeLyricToy:Softpedia | GoogleCodeRCTunes:Softpedia | GoogleCodeMichtaToolsProgrammer n. - An ingenious device that turns caffeine into code.

Share this post


Link to post
Share on other sites
GaryFrost

$int = 5
$s =StringFormat ( "%.2d" , $int )
msgbox(0, "Result", $s)


SciTE for AutoItDirections for Submitting Standard UDFs

 

Don't argue with an idiot; people watching may not be able to tell the difference.

 

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×