how do i format a number to display 5 digits with leading zeros? e.g. integer '1' will be displayed as '00001' and integer 12 will be displayed as '00012'.
Function AddLeadingZeros(iLen, sStr)
sStr = CStr(sStr)
Do While Not Len(sStr) = iLen
sStr = "0" & sStr
Loop
AddLeadingZeros = sStr
End Function
you would call it like:
Dim sFormattedNumber
sFormattedNumber = AddLeadingZeros(5, CStr(numbertoformat))
note that the numbers become strings, and are no longer integers
[sig]<p>ray<br><a href=mailto:rheindl@bju.edu>rheindl@bju.edu</a><br><a href= > </a><br> [/sig]
is just done in the "immediate" window. Of course, you can ignore the NumPad thing and just put the "5" directly into the format statement and get the same results.
[sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
unless what ever language mako is using (he will let us know - won't he?) doesn't support some part of this. [sig]<p>MichaelRed<br><a href=mailto:mred@duvallgroup.com>mred@duvallgroup.com</a><br>There is never time to do it right but there is always time to do it over[/sig]
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.