Browse Source

小数位数计算相关

MaiXinRong 7 năm trước cách đây
mục cha
commit
a52229d27b
1 tập tin đã thay đổi với 4 bổ sung1 xóa
  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;