marcelo27
asked on
add leading zeroes
I need to add leading zeroes to an input box.
For example, the user enters "2" , I need to convert to a three digit number eg."002".
If the user enters a three digit number leave it alone.
thanks for your help .
For example, the user enters "2" , I need to convert to a three digit number eg."002".
If the user enters a three digit number leave it alone.
thanks for your help .
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
marcelo27:
i was giving an example and num is what you have to assign, my primary objective is to let you know that my function works :) if i didn't put the num there and an example value, you wouldn't be able to see the working code and it would be harder to understand.
hope that explains why i put "2" as num, you can put and assign any number from anywhere to the num variable.
i was giving an example and num is what you have to assign, my primary objective is to let you know that my function works :) if i didn't put the num there and an example value, you wouldn't be able to see the working code and it would be harder to understand.
hope that explains why i put "2" as num, you can put and assign any number from anywhere to the num variable.
ASKER
The user can enter any numerical value. If the user enters a one or double digit number zeroes need to be added. The maximum length of string is 3.