我菜,但我有分 ,给!!! 问题:如何将整数转换为规定位数的字符串 100分 快,等着用 如何将整数转换为规定位数的字符串如 i:=123转换为 000123 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 i := 123;s := StringOfChar('0', 6 - Length(IntToStr(i))) + IntToStr(i); procedure TForm1.Button1Click(Sender: TObject);var tt : String;begin FmtStr(tt, '000%d', [123]); showmessage(tt);end; var s:string; i:integer;begin i:=123; s:='000000000';// 足够多的 0 s:=s+IntToStr(i); //下面语句取字符串最后6位 s:=copy(s,length(s)-6,6);// s等于'000123'end; function LeadZero(const aIntValue, aWidth: Integer): string;begin Result := Format(Format('%%.%dd', [aWidth]), [aIntValue]);end; function LeadZero(const aIntValue: Int64; const aWidth: Integer): string;begin Result := Format(Format('%%.%dd', [aWidth]), [aIntValue]);end;aWidth <= 32 Delphi程序自动退出 有关ACTIVEX和IE相互通信的问题 为什么下载的源码可以正常调试,但不能修改,修改后保存就提示出错!!! dxDBTreeList1顯示的列是否有修改功能! 城聘Delphi软件开发人员 关于stringgrid 的问题 小问题,在线等! 有谁知道什么是msdn啊 问一声:各位在和别人合作开发时最后怎么组合起来的? 在delphi中Project问题,急 如何使用WINSOCK控件及相关API对网络封包进行拦截和修改?? SelectDirectory的用法!!
s := StringOfChar('0', 6 - Length(IntToStr(i))) + IntToStr(i);
var
tt : String;
begin
FmtStr(tt, '000%d', [123]);
showmessage(tt);
end;
s:string;
i:integer;
begin
i:=123;
s:='000000000';// 足够多的 0
s:=s+IntToStr(i);
//下面语句取字符串最后6位
s:=copy(s,length(s)-6,6);// s等于'000123'
end;
begin
Result := Format(Format('%%.%dd', [aWidth]), [aIntValue]);
end;
begin
Result := Format(Format('%%.%dd', [aWidth]), [aIntValue]);
end;aWidth <= 32