Format number to have X chars

Results 1 to 2 of 2

Thread: Format number to have X chars

  1. #1
    Join Date
    Dec 1969

    Default Format number to have X chars

    I&#039;m trying to format a integer for a four digit integer with some asp.<BR>Seems simple enough. I just want the output to be 0001 instead of 1. Can&#039;t<BR>find the correct syntax in any book or web site. I can format currency,<BR>percentage but not a simple number. Any suggestions?<BR><BR><BR>&#060;%FormatReqNum = Session("sesTrackingNumber")%&#062;<BR>&#060;%Resp onse.Write Format????(FormatReqNum,0000)%&#062;<BR>

  2. #2
    Nils Bilhorn Guest

    Default RE: Format number to have X chars

    tmpStr = Cstr(Cint(Session("sesTrackingNumber")))<BR>Respon se.write right("0000" & tmpStr ,4)<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts