Formatting Numbers

Results 1 to 3 of 3

Thread: Formatting Numbers

  1. #1
    Isaac Guest

    Default Formatting Numbers

    okay, so this is silly... i am in a situation where i need to format numbers to exactly 6 digits, with leading zeros if need be. i can remember long ago using Print Using "####... but haven't done this in vbScript yet, thanks!

  2. #2
    Join Date
    Dec 1969
    Los Angeles, CA

    Default RE: Formatting Numbers

    try this<BR><BR>varname = left("00000" & yournumber, 6)

  3. #3
    Isaac Guest

    Default RE: Formatting Numbers

    thanks!... but one small problem, you had it backwards, it should be<BR><BR>var = right("00000" & num, 6)<BR><BR>my numbers are different lengths, some 1 digit, 2, 3, and 4 digits, too... using left would only return the five zero&#039;s and the first digit of my number that needed formatting...<BR><BR>thanks again!

Posting Permissions

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