Formatting Number

sabzamsabzam Member Posts: 1,149
Hi Everybody,

I have got a variable integer with value 1 and would like to change it into text but it has to be changed to 01 and not 1. Is this possible?

Comments

  • tinoruijstinoruijs Member Posts: 1,226
    txtNumber := '0' + format(intNumber);

    Tino Ruijs
    Microsoft Dynamics NAV specialist
  • sabzamsabzam Member Posts: 1,149
    Yepp that's a possible solution though I was looking for a "cleaner" one - i.e. maybe where the format itself creates it without any extra intervention
  • jorgitojorgito Member Posts: 115
    Hi sabzam.

    You could try
    txtNumber := PADSTR(FORMAT(intNumber), 2, '0');
    
Sign In or Register to comment.