# Single.Round 方法

## 重载

 Round(Single) 使用默认舍入模式 () ToEven 将值舍入为最接近的整数。 Round(Single, Int32) 使用默认舍入模式 () ToEven 将值舍入到指定的小数位数。 Round(Single, MidpointRounding) 使用指定的舍入模式将值舍入为最接近的整数。 Round(Single, Int32, MidpointRounding) 使用默认舍入模式 () ToEven 将值舍入到指定的小数位数。

## Round(Single)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

x
Single

## Round(Single, Int32)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

x
Single

digits
Int32

## Round(Single, MidpointRounding)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

x
Single

mode
MidpointRounding

## Round(Single, Int32, MidpointRounding)

Source:
Single.cs
Source:
Single.cs
Source:
Single.cs

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

x
Single

digits
Int32

mode
MidpointRounding