<p>I need to have a string, based on an integer, which should always have 5 digits.</p>

<p>Example:</p>

<pre><code>myInteger = 999
formatedInteger = "00999"
</code></pre>

<p>What is the best way of doing this in classic ASP?</p>

Something like this is what I've seen most of the time:
```
```
function PadNumber(number, width)
   dim padded : padded = cStr(number)

   while (len(padded) < width)
       padded = "0" & padded
   wend

   PadNumber = padded
end function

PadNumber(999, 5) '00999
```
```