瀏覽代碼

小数位数计算相关

MaiXinRong 7 年之前
父節點
當前提交
a52229d27b
共有 1 個文件被更改,包括 4 次插入1 次删除
  1. 4 1
      Units/UtilMethods.pas

+ 4 - 1
Units/UtilMethods.pas

@@ -234,7 +234,10 @@ begin
     end;
   P := @X;
   CopyMemory(P, @Buf[0], SizeOf(X));
-  Result := InnerRoundTo(X, ADigit, RoundMode);
+  if (ADigit <= -6) and (ADigit < GetTrueDigit(AValue)) then
+    Result := AValue
+  else
+    Result := InnerRoundTo(X, ADigit, RoundMode);
 end;
 
 function CommonCalcRoundTo(AValue: Double): Double;