delphi 数字转换十进制

来源:百度知道 编辑:UC知道 时间:2024/05/01 17:01:56
比如i:=12312

我想把他用delphi把i转换为十进制,不足五位后面加个0并输出,请把运行代码写出来,谢谢!

请勿乱答

procedure TForm1.Button1Click(Sender: TObject);
var
i,m:integer;
s:string;
begin
i:=0;
s:=edit1.Text;
m:=length(s);
case m of
1: i:=strtoint(s)*10000;
2: i:=strtoint(s)*1000;
3: i:=strtoint(s)*100;
4: i:=strtoint(s)*10;
5: i:=strtoint(s);
else
begin
showmessage('输入内容为空,请输入数字');
edit1.SetFocus;
end;
end;
if i<>0 then
showmessage(inttostr(i));
end;