I have created a formula to get a fixed length character that I can dump to a flat file. It works great for characters however, it doesn't do well with numbers. For example: I have inventory qty of item ABC and it is 2500 eaches. Here's the formula I created:
NumberVar RequiredLength:= 11;
NumberVar CurrentLength:= Length (TOTEXT ({inv_loc.qty_on_hand}));
IF RequiredLength < CurrentLength
THEN TOTEXT({inv_loc.qty_on_hand}) [1 TO RequiredLength]
ELSE ReplicateString ("0",RequiredLength - CurrentLength) + TOTEXT ({inv_loc.qty_on_hand})
Thus, the result now is 0002,500.00 - Is there a way for me to get 00000002500 instead? Any advice?
Thanks.
NumberVar RequiredLength:= 11;
NumberVar CurrentLength:= Length (TOTEXT ({inv_loc.qty_on_hand}));
IF RequiredLength < CurrentLength
THEN TOTEXT({inv_loc.qty_on_hand}) [1 TO RequiredLength]
ELSE ReplicateString ("0",RequiredLength - CurrentLength) + TOTEXT ({inv_loc.qty_on_hand})
Thus, the result now is 0002,500.00 - Is there a way for me to get 00000002500 instead? Any advice?
Thanks.