Toggle navigation
Categories
Discussions
Activity
Best Of...
Sign In
Home
›
AMX Forum
›
AMX General Discussion
Displaying an integer
kmenshouse
Junior Member
September 2007
in
AMX General Discussion
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
0
·
Share on Facebook
Share on Twitter
Comments
Joe Hebert
Junior Member
September 2007
Yes there is. Check out the FORMAT command. It would be something like:
FORMAT('%02d',nMyInteger)
0
·
Share on Facebook
Share on Twitter
Chip Moody
Junior Member
September 2007
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
0
·
Share on Facebook
Share on Twitter
Sign In
or
Register
to comment.
Comments
FORMAT('%02d',nMyInteger)
- Chip