Home AMX User Forum AMX General Discussion
Options

Displaying an integer

Is there a way to set the number of places for an integer, so you can send two digits to a display, with the first being zero?

Thanks,
Keith

Comments

  • Options
    Joe HebertJoe Hebert Posts: 2,159
    Yes there is. Check out the FORMAT command. It would be something like:

    FORMAT('%02d',nMyInteger)
  • Options
    Heh. Before the FORMAT command, I used to do something like pad_num = RIGHT_STRING ("'00',ITOA(my_integer)",3) to - for example - get three digits at all times, even if the first one or two were a leading zero.

    - Chip
Sign In or Register to comment.