| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
format string / fixed length / prefix character
Hi,
ive got a string variable that holds numbers (Dim euNumber) euNumber can be of any length raging from 1-6. For presentation purpouses euNumber has to be of length 6. If the original is less than 6 digits long then a number of "0"'s should be added to the left side of the string If the string is empty then leave the string empty. euNumber is called in using a request.form() I have tried the following: Quote:
The above method does not work, if the string already is of length 6, it will adds a "0" in front of it still. resulting of a string length of 7 Is there an easier ay to format strings? Can I use the FormatNumber function to do this? |
|
#2
|
||||
|
||||
|
A nice solution is:
Code:
euNumber = right("000000" & euNumber, 6)
|
|
#3
|
|||
|
|||
|
fantastic,
many thanks ![]() |
![]() |
| Viewing: ASP Free Forums > Programming > Code Bank > format string / fixed length / prefix character |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|