MathNRoundTNumeric(TNumeric, MidpointRounding) Method
Rounds a value to a specified number of fractional digits using the specified rounding convention.
Namespace: Jodosoft.NumericsAssembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static TNumeric Round<TNumeric>(
TNumeric x,
MidpointRounding mode
)
where TNumeric : struct, new(), INumeric<TNumeric>
Public Shared Function Round(Of TNumeric As {Structure, New, INumeric(Of TNumeric)}) (
x As TNumeric,
mode As MidpointRounding
) As TNumeric
public:
generic<typename TNumeric>
where TNumeric : value class, gcnew(), INumeric<TNumeric>
static TNumeric Round(
TNumeric x,
MidpointRounding mode
)
static member Round :
x : 'TNumeric *
mode : MidpointRounding -> 'TNumeric when 'TNumeric : struct, new() and INumeric<'TNumeric>
- x TNumeric
-
- mode MidpointRounding
- One of the enumeration values that specifies which rounding strategy to use.
- TNumeric
TNumeric
The number that has
digits fractional digits that
value is rounded to.
If
value has fewer fractional digits than
digits,
value is returned unchanged.
This method may return
NaN or Infinity.
If
NaN or Infinity cannot be represented by
TNumeric,
then this method may throw an
ArithmeticException.