: For example, if I want all Integer output 4 digits, can I convert 28 to ' 28' instead of '28'?
:
: Thank you!
:
:
The following code will work in both cases:
s := some number conversion;
while Length(s) < SomeLength do
s := ' ' + s;
Thus in case of an integer it becomes:
s := IntToStr(28);
while Length(s) < 4 do
s := ' ' + s;
If you want to have an output of 0028, you can also use the Format() statement:
s := Format('%.4d', [28]);