Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - Delphi string is converted into two-digit format when it is finalized.
Delphi string is converted into two-digit format when it is finalized.
There seems to be no such function, but it is not difficult to write one yourself. You can use this function directly in the following sample program:

{$apptype console $}

Function nstr0(x, n: integer): string; //Call example writeln (nstr0 (123,5); Output 00 123

Var i: integer;

begin

Setlength (result, n);

for i:=n downto 1 do

begin

result[I]:= chr(ord(' 0 ')+x mod 10);

x:= x div 10;

End;

End;

begin

write(nstr0( 123,5));

End.