--仿照:Delphi中double类型真正实现四舍五入(保留两位)_踏雪无痕-CSDN博客_delphi 四舍五入保留两位小数 https://blog.csdn.net/zhongguoren666/article/details/6659781
-----------------------------------------------------------
/// <summary>
/// <remarks>
/// 浮点类型四舍五入
/// </remarks>
/// <param name="sFloat">当前需要四舍五入的浮点数 Double</param>
/// <param name="sInt">从第几位开始四舍五入 Word</param>
/// </summary>
/// <returns>Double</returns>
function RoundFloat(sFloat: Extended;sInt: Word): Extended;
function RoundFloat(sFloat: Extended; sInt: Word):Extended;
var
vS:string;
begin
result:=0;
if sFloat=0 then
Exit;
if( (-0.5<sFloat) and (sFloat<0.5)
and (sInt=0) )then
Exit;
vS:='#.'+ StringOfChar('0',sInt);
result:=StrToFloat(FormatFloat(vS,sFloat));
end;