Print Decimal Number With Defined Number of Characters

 

Im looking to print the following

value :3  as 00003

value :124 as 00124

value :8324 as 08324

in this case it would be 5 characters.. 

is it possible?

Thanks             
 

 
Look in the reference for PrintFormat() of StringFormat().
 

Do you mean you want decimals as in your value 3 is actually .00003, or you want 3 with leading zeros that would normally not be there?

It makes a difference.  But, if you want to output stuff, you need to convert your data to a string in some way.

Here are some doc links to get you started.

Conversion Functions

String Functions

Common Functions

 
PrintFormat("%05d", 3); // 00003
 

Got it suiting my needs using:

 int number = 3;

 string NumbWith6Digits =  IntegerToString(number,6,'0'); 

 
Thank You guys!
Reason: