Double.Round 方法

定義

多載

Round(Double)

使用預設進位模式將值四捨五入為最接近的整數, (ToEven) 。

Round(Double, Int32)

使用預設進位模式將值四捨五入為指定的小數位數, () ToEven

Round(Double, MidpointRounding)

使用指定的進位模式,將值四捨五入為最接近的整數。

Round(Double, Int32, MidpointRounding)

使用預設進位模式將值四捨五入為指定的小數位數, () ToEven

Round(Double)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs

使用預設進位模式將值四捨五入為最接近的整數, (ToEven) 。

public:
 static double Round(double x) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round (double x);
static member Round : double -> double
Public Shared Function Round (x As Double) As Double

參數

x
Double

要捨入的值。

傳回

使用預設進位模式四捨五入 x 至最接近整數的結果。

實作

適用於

Round(Double, Int32)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs

使用預設進位模式將值四捨五入為指定的小數位數, () ToEven

public:
 static double Round(double x, int digits) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round (double x, int digits);
static member Round : double * int -> double
Public Shared Function Round (x As Double, digits As Integer) As Double

參數

x
Double

要捨入的值。

digits
Int32

應四捨五入的小數位數 x

傳回

使用預設舍入模式四捨五入 xdigits 小數位數的結果。

實作

適用於

Round(Double, MidpointRounding)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs

使用指定的進位模式,將值四捨五入為最接近的整數。

public:
 static double Round(double x, MidpointRounding mode) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round (double x, MidpointRounding mode);
static member Round : double * MidpointRounding -> double
Public Shared Function Round (x As Double, mode As MidpointRounding) As Double

參數

x
Double

要捨入的值。

mode
MidpointRounding

應該四捨五入的 x 模式。

傳回

使用 mode 四捨五入 x 為最接近整數的結果。

實作

適用於

Round(Double, Int32, MidpointRounding)

來源:
Double.cs
來源:
Double.cs
來源:
Double.cs

使用預設進位模式將值四捨五入為指定的小數位數, () ToEven

public:
 static double Round(double x, int digits, MidpointRounding mode) = System::Numerics::IFloatingPoint<double>::Round;
public static double Round (double x, int digits, MidpointRounding mode);
static member Round : double * int * MidpointRounding -> double
Public Shared Function Round (x As Double, digits As Integer, mode As MidpointRounding) As Double

參數

x
Double

要捨入的值。

digits
Int32

應四捨五入的小數位數 x

mode
MidpointRounding

應該四捨五入的 x 模式。

傳回

使用 mode 四舍五 x 入為 digits 小數位數的結果。

實作

適用於