Archive: Trying to find a unique use for IntFmt


Trying to find a unique use for IntFmt
I have a process that needs to read a section from an INI file. But the number format is something like "001=, 002=... 012=... 123=". (Always 3 characters padded by zeros).

I need a way to take a number and add the zeros. I know I could build a function that just looks at the length and adds the zero. However, I was hoping I could do it simpler by using IntFmt. According to this article it seems I should be able to do it. Unfortunatley, I haven't been able to come up with the proper format string to make it work the way I'd like.

So, I'm posting in this to see if anyone might have a way to do what I'm asking using IntFmt. If not, it's no big deal--I can just go back to my original plan.


IntFmt $0 "%0.3u" 2
(Untested)


Yes! That worked perfectly. Thanks, Anders! :up: