format number.....HELP!

Results 1 to 2 of 2

Thread: format number.....HELP!

  1. #1
    Join Date
    Dec 1969

    Default format number.....HELP!

    hi!...i want to display a number in 3 digits...<BR>like if i have the number 3 i want it to be 003...<BR>in VB there is such ting as format to do abt in vbscript?...please help!<BR>thanks!

  2. #2
    jason Guest

    Default RE: format number.....HELP!

    involves conversion to strings<BR><BR>if num &#062; 9 and num &#060; 100<BR>num = "0" & Cstr(num)<BR>elseif num &#062;0 and num &#060; 10<BR>num = "00" & CStr(num)<BR>end if<BR><BR>which is fine is you&#039re only going up to 999, which it looks like you are. going above, it may be easier to use the length of the number as a string (len(Cstr(num))) to determine how many zeroes you need to add.<BR><BR>jason<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