Mega Code Archive

 
Categories / Delphi / Strings
 

Convert a number to a string with leading zeroes

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