Explorar o código

小数位数计算相关

MaiXinRong %!s(int64=7) %!d(string=hai) anos
pai
achega
a52229d27b
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  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;