Support Forums
Leading zeroes in numerical conversion to string

I am trying to create a text port that allows the user to enter a lift station number and then click to open the detail page for that station. In order to make everything work smoothly I need my lift station number to resolve to a three digit string. Is there a function that will force leading zeroes in an integer to string conversion? The Format function seems to operate in exact reverse of what I need (oddly).

Thanks

I am trying to create a text port that allows the user to enter a lift station number and then click to open the detail page for that station. In order to make everything work smoothly I need my lift station number to resolve to a three digit string. Is there a function that will force leading zeroes in an integer to string conversion? The Format function seems to operate in exact reverse of what I need (oddly). Thanks

If you need it as an expression then this should work, where "n" is the number:

Concat(MakeBuff(2-Int(Log(n)), 0x30) , Format(0,0,n))

If you need it as an expression then this should work, where "n" is the number: Concat(MakeBuff(2-Int(Log(n)), 0x30) , Format(0,0,n))

Lawrence MacNeil
Trihedral Engineering Limited

edited Jan 16 '23 at 6:34 pm
37
1
2
live preview
enter atleast 10 characters
WARNING: You mentioned %MENTIONS%, but they cannot see this message and will not be notified
Saving...
Saved
With selected deselect posts show selected posts
All posts under this topic will be deleted ?
Pending draft ... Click to resume editing
Discard draft