Doens.be

  • Linkedin flickr twitter delicious Facebook Youtube

Posts Tagged ‘str’

Add leading zeros

You want to show a integer with a fixed length (for example 2characters: 1 –> 01). You don’t have to write your own for-loop to ad the zero’s in front or something like that. The function strRFix does this for you automaticly.

1
info(strRFix(int2str(1), 2, '0'));

Note: there is also a strLFix