delphi 显示比例问题 怎么让比例以百分比的方式显示出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Format函数Format('x=%%', []); //'x=%' //得到"%" 我拼装了一个函数,你可以试一试,其中DotCount是百分比形式小数位有多少位的设置,默认为2个小数位。function ShowAsPercent(const f: Double; const DotCount: Integer = 2): string; var fmtStr: string; const sPercent = '%'; begin fmtStr := Format('%s.%df', [sPercent, DotCount]); Result := Format('%s%s', [Format(fmtStr, [f * 100]), sPercent]); end; 直接在代码里写,用2楼说的Format函数就可以实现。 简单,哪错了 Listview怎么去掉滚动条?重分相送! Delphi8如何调用c#写的dll? 关于WebBrowser的几个简单问题 为什么双机通讯不成功,难道是物理线路的问题?请教~! 一个简单问题 关于内存映射文件问题。请帮忙。 究竟是哪里错了呢? 为什么不能用"Max"?在线等待,急!!! 困惑啊,来看看吧。很帅的问题! DBGridEh 回车或者TAB不换行 怎么办? delphi中 Grid问题、、求指导、、
Format('x=%%', []); //'x=%' //得到"%"
function ShowAsPercent(const f: Double; const DotCount: Integer = 2): string;
var
fmtStr: string;
const
sPercent = '%';
begin
fmtStr := Format('%s.%df', [sPercent, DotCount]);
Result := Format('%s%s', [Format(fmtStr, [f * 100]), sPercent]);
end;