The number nearest the specified TdDecimal’s value and position is calculated.
Parameters
- input
- The TdDecimal that will be rounded.
- position
- The decimal place where rounding will occur.
Return Value
The result of the round operation is returned as a TdDecimal.
The following is an example that rounds a TdDecimal at various positions:
//M indicates that the numeric literal is a System.Decimal
TdDecimal original = new TdDecimal(867498.23535M);
TdDecimal result1 = TdDecimal.Round(original, 2);
TdDecimal result2 = TdDecimal.Round(original, 4);
//The results will be as follows:
// result1 = 867498.24
// result2 = 867498.2354
original = new TdDecimal(867498.646525M);
TdDecimal result3 = TdDecimal.Round(original, 3);
TdDecimal result4 = TdDecimal.Round(original, 5);
//The results will be as follows:
// result3 = 867498.647
// result4 = 867498.64652
Target Platforms: Windows 7, Windows 8, Windows 8.1, Windows 10, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2