一个看似简单的问题:浮点数和字符串之间的转换? 使用floattostr转换时,浮点数首先变成extended类型,转换为字符串后多出一些小数.0.1234变成'0.1234117178'.如何使字符串等于'0.1234'??????不要说用format,要能够自动判断小数位数. 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 原型:function FormatFloat(const Format: string; Value: Extended): string; overload;function FormatFloat(const Format: string; Value: Extended; const FormatSettings: TFormatSettings): string; overload;The following table shows some sample formats and the results produced when the formats are applied to different values:Format string- 1234 -1234 0.5 01234 -1234 0.5 00 1234 -1234 1 00.00 1234.00 -1234.00 0.50 0.00#.## 1234 -1234 .5 #,##0.00 1,234.00 -1,234.00 0.50 0.00#,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00#,##0.00;;Zero 1,234.00 -1,234.00 0.50 Zero0.000E+00 1.234E+03 -1.234E+03 5.000E-01 0.000E+00#.###E-0 1.234E3 -1.234E3 5E-1 0E0 idftp问题 【亮剑】【泰坦】恭喜两个斑竹大人获取优秀! 小弟请教一个笔试的题目 Missing operator or semicolon 怎么写杀不死Win32程序 调用VC写的COM组件出现问题,高手解答 请教如何使用BusinessSkinForm组件,谢谢! 问一个Pop菜单问题,希望得到指点,最好不要灌水。解决另单开贴给分... 求救!请帮帮我 如何把SQL语句的查询结果直接从打印机输出? 一个看起来很简单的问题:字符串和浮点数的转换 菜鸟问题:怎样把标题栏屏蔽掉!
function FormatFloat(const Format: string; Value: Extended): string; overload;
function FormatFloat(const Format: string; Value: Extended; const FormatSettings: TFormatSettings): string; overload;
The following table shows some sample formats and the results produced when the formats are applied to different values:
Format string- 1234 -1234 0.5 0
1234 -1234 0.5 0
0 1234 -1234 1 0
0.00 1234.00 -1234.00 0.50 0.00
#.## 1234 -1234 .5
#,##0.00 1,234.00 -1,234.00 0.50 0.00
#,##0.00;(#,##0.00) 1,234.00 (1,234.00) 0.50 0.00
#,##0.00;;Zero 1,234.00 -1,234.00 0.50 Zero
0.000E+00 1.234E+03 -1.234E+03 5.000E-01 0.000E+00
#.###E-0 1.234E3 -1.234E3 5E-1 0E0