A: This will take a number typed into edit1.text and pad it with as many zeros as needed to get the string to at least 5 characters.
var s: string; begin FmtStr(s, '%.5d', [StrToInt(edit1.text)]); edit1.text := s; end;