Number Formatting Command, Please Help!

Results 1 to 2 of 2

Thread: Number Formatting Command, Please Help!

  1. #1
    Join Date
    Dec 1969

    Default Number Formatting Command, Please Help!

    --------------------------------------------------------------------------------<BR>I know the formatnumber() function can allow you to specify a specific amount of decmal places a number can go (ie, 12.222), but is there a way to have a fixed length for the integer itself? For example, instead of 1, i need 001. for 12, i need 012. I know i could do some if statements, but I would rather use a built in function for this. Can somone help me out? Thanks,<BR><BR>P.S. you can email me at

  2. #2
    Cliff Osburn Guest

    Default RE: Number Formatting Command, Please Help!

    Here is a function that will work for you:<BR><BR>Function ZeroPad(pad, places)<BR>While places &#062; Len(pad)<BR>pad = "0" & pad<BR>Wend<BR>ZeroPad = pad<BR>End Function <BR><BR>The arguments are:<BR>pad=the number you wish to format<BR>places=total number of places for the number <BR><BR>If you wanted to format &#039 12&#039 as ?&#039 then you would call the function as follows:<BR><BR>zeropad(12,3)<BR><BR>I hope this helps!

Posting Permissions

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