DoubleExtensions

StockSharp.Xaml.Charting.Common.Extensions

Methods

RoundOff
internal static double RoundOff(double d, int decimals, MidpointRounding mode)
result = DoubleExtensions.RoundOff(d, decimals, mode)

Rounds using arithmetic (5 rounds up) symmetrical (up is away from zero) rounding

d
A double number to be rounded.
decimals
The number of significant fractional digits (precision) in the return value.
mode
The midpoint rounding mode

Returns: The number nearest d with precision equal to decimals. If d is halfway between two numbers, then the nearest whole number away from zero is returned.