Single.Round Method

Definition

Overloads

Round(Single, Int32, MidpointRounding)

Rounds a value to a specified number of fractional-digits using the default rounding mode (ToEven).

Round(Single, MidpointRounding)

Rounds a value to the nearest integer using the specified rounding mode.

Round(Single)

Rounds a value to the nearest integer using the default rounding mode (ToEven).

Round(Single, Int32)

Rounds a value to a specified number of fractional-digits using the default rounding mode (ToEven).

Round(Single, Int32, MidpointRounding)

Rounds a value to a specified number of fractional-digits using the default rounding mode (ToEven).

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

Parameters

x
Single
digits
Int32

Returns

Single

The result of rounding x to digits fractional-digits using mode.

Implements

Applies to

Round(Single, MidpointRounding)

Rounds a value to the nearest integer using the specified rounding mode.

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

Parameters

x
Single

Returns

Single

The result of rounding x to the nearest integer using mode.

Implements

Applies to

Round(Single)

Rounds a value to the nearest integer using the default rounding mode (ToEven).

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

Parameters

x
Single

Returns

Single

The result of rounding x to the nearest integer using the default rounding mode.

Implements

Applies to

Round(Single, Int32)

Rounds a value to a specified number of fractional-digits using the default rounding mode (ToEven).

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

Parameters

x
Single
digits
Int32

Returns

Single

The result of rounding x to digits fractional-digits using the default rounding mode.

Implements

Applies to