Link to home
Start Free TrialLog in
Avatar of tmajor99
tmajor99

asked on

JavaScript to Fill a var with leading zeros.

I need a javascript that will fill a variable with leading zeros so it always stays 7 bytes in length.

For example:
Before                  After
13777                 0013777
  4022                 0004022
1                         0000001
99                       0000099
ASKER CERTIFIED SOLUTION
Avatar of Gregg
Gregg
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Rainer Jeschor
Rainer Jeschor
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial