Mega Code Archive

 
Categories / Delphi / Strings
 

How to convert a number to a string with leading zeroes

Title: How to convert a number to a string with leading zeroes procedure TForm1.Button1Click(Sender: TObject); begin label1.Caption := Format('%.*d', [10, 1456]); // --- 0000001456 end;