Putting Leading Zeros in Front of a Number
How do you put leading zeros in front of a number in eFORMz? Let’s say a numeric value of 4.69 needs to be converted to 00000000469. There are at least two methods of controlling the total length of the field in question. Both methods are demonstrated in the following sample: LeftFillSample
The first method would involve creating a variable and setting the value with the required number of zeros. Next, that variable would be inserted as a string in front of the numeric value. If the number of zeros changes, a substring function could be employed or the “fill” variable containing the number of zeros can be adjusted accordingly.
The second method might be more attractive for values with commas and decimal points that need to be removed. It involves replacing the commas and decimals then using a numeric format procedure to add the necessary number of zeros.