Padding or formatSpec for field width?

Hi,
how can I convert a number to srting into defined field width?
Or left padding a string to defined total length.
For example, let the length 5,
in case 123 the result let " 123"
in case 4321 -> " 4321"

Regards,
Zsolt

Convert the number to a string, check the string length, if it’s too short add the desired number of characters.
http://documentation.xojo.com/index.php/Str
http://documentation.xojo.com/index.php/Len

If you’re just trying to position a number in a TextField or Label you should look at the alignment property instead.

Thank you!

Or something like this:
Right( " " + Str( number ) ), 5 )