padLeadingZeros

padLeadingZeros(int: Integer): String;

The padLeadingZeros method of the String primitive type returns a string of the length specified in the int parameter, consisting of the receiving string padded with leading zeros.

The following example shows the use of the padLeadingZeros method.

vars
    stringValue : String;
begin
    stringValue := '123.45';
    write stringValue.padLeadingZeros(10);   // Outputs '0000123.45'
end;