Add leading zeros

  • July 31, 2009
  • 1 Comment

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.

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

Note: there is also a strLFix

  1. Art Of Creation – Dynamics AX Blog » Remove leading zeros left a comment on August 3, 2009 at 10:48 am

    […] you’ll want to add leading zeros to a string, but other times, you’ll have to remove leading zeros from a string. Here the code that does […]

Comments are closed.