请指教? 我是菜鸟real 如何转换为 String ?
或者 其他型也可,只要能在程序中显示出来就ok拉!!!
或者 其他型也可,只要能在程序中显示出来就ok拉!!!
解决方案 »
- delphi7怎么用ADO控件连接VFP的数据库文件
- delphi 中的ProgressBar怎么与函数联系
- 如何从数据库中取出数据
- 一个变量是pchar,比如我想取第5到第10位的值,怎么操作????
- 怎么样声明一个类拟于vb中的object类型的变量?
- 开年去面试,现寻求帮助,谢谢
- 为了csdn的人气,散分!!!
- 寻求李维<delphi5.x 分布式多层应用>系统篇所带光盘中的例程
- 谁用天敏的SDK-2000做过视频开发?俺急需帮助!有偿!
- 小妹有难!!!急需各路英雄鼎力相助!
- query用了order以后连接到dbgrid,但不能修改这个表了
- 如何用DELPHI编程备份SQLSERVER数据库
Function RealToStr (R :Real) :String;
const MAS = 10000000;
MIS = 0.0000001;
var Z :String;
EF :Boolean;
c :Char;
begin
if ((Abs (R) < MAS) and (Abs (R) > MIS)) or (R = 0) then
begin
Str (R:17:16, Z);
EF:= False;
while not EF do
begin
c:= Z [Length (Z)];
if (c = '0') or (c = '.')
then Z:= Copy (Z, 1, Length (Z) - 1)
else EF:= True;
if (c = '.') or (Length (Z) <= 1) then EF:= True;
end;
while Z [1] = ' ' do Z:= Copy (Z, 2, Length (Z) - 1);
end
else
begin
Str (R, Z);
while Z [1] = ' ' do Z:= Copy (Z, 2, Length (Z) - 1);
end;
RealToStr:= Z;
end;
floattostr()floattostr()floattostr()floattostr()floattostr()floattostr()
用Single或者Double吧。