怎么让比例以百分比的方式显示出来  

解决方案 »

  1.   

    Format函数
    Format('x=%%', []); //'x=%' //得到"%"
      

  2.   

    我拼装了一个函数,你可以试一试,其中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;
      

  3.   

    直接在代码里写,用2楼说的Format函数就可以实现。