Explorar el Código

小数位数计算相关

MaiXinRong hace 7 años
padre
commit
a52229d27b
Se han modificado 1 ficheros con 4 adiciones y 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;