MathNRoundTNumeric(TNumeric, MidpointRounding) Method

Rounds a value to a specified number of fractional digits using the specified rounding convention.

Definition

Namespace: Jodosoft.Numerics
Assembly: Jodosoft.Numerics (in Jodosoft.Numerics.dll) Version: 2.0
public static TNumeric Round<TNumeric>(
	TNumeric x,
	MidpointRounding mode
)
where TNumeric : struct, new(), INumeric<TNumeric>

Parameters

x  TNumeric
 
mode  MidpointRounding
One of the enumeration values that specifies which rounding strategy to use.

Type Parameters

TNumeric

Return Value

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.

Remarks

This method may return NaN or Infinity. If NaN or Infinity cannot be represented by TNumeric, then this method may throw an ArithmeticException.

See Also