两位数简单,直接IntToStr就行了,
但是个位数呢?用什么函数呢?
但是个位数呢?用什么函数呢?
解决方案 »
- intraweb 中 动态显示多个相同的图片
- 100分求解动态生成
- imagelist1.Draw(form1.Canvas,10,20,0)的时候画出的图片很小,如何设置其显示为原始大小
- integer转single类型??
- 同时画三个图,用三个TIMER该怎么画?散分!
- 有谁能以详细解释,关Delphi中Demos--midas--pooler中原理,认我参透其中的原理(200分)
- 都说b/s模式可减少维护量,可实在不好处理交互处理多的应用,有什么好办法?
- 快来拿分啊~~很简单的问题哦~~~
- 怎样获得某SQL,中的所有数据库的名称?
- 高手又请!
- 一个文件操作的问题!!急!!在线等待!!!!!!!!!!!!!!
- 什么叫VCL?
function MyFunc(N: Integer): string;
begin
Result := IntToStr(N);
if Length(Result) = 1 then
Result := '0' + Result;
end;
var
i : integer;
begin
result := IntToStr(value);
for i := 1 to size - Length(result) do
begin
result := '0' + result;
end;
end;procedure TForm1.Button2Click(Sender: TObject);
begin
Edit1.Text := IntToStr(4, 2);
end;
var
i:integer;
begin
i:=4;
caption:=FormatFloat('00',i)
end;
d Decimal. The argument must be an integer value. The value is converted to a string of decimal digits. If the format string contains a precision specifier, it indicates that the resulting string must contain at least the specified number of digits; if the value has less digits, the resulting string is left-padded with zeros.
里面就讲到了为整数指定精度其实就是指定了返回字符串的宽度,宽度不足就会在左边补零。
也谢谢 hch_45(HCH ~ahong.net~) ,你给函数比我写的好多了^_^