Round Method
Definition
- Namespace
- Cuemon.Extensions
- Assemblies
- Cuemon.Extensions.Core.dll
Round(TimeSpan, double, TimeUnit, VerticalDirection)
Returns a TimeSpan value that is rounded either towards negative infinity or positive infinity.
public static TimeSpan Round(this TimeSpan value, double interval, TimeUnit timeUnit, VerticalDirection direction)
Parameters
valueTimeSpanA TimeSpan value to be rounded.
intervaldoubleThe double value that in combination with
timeUnitspecifies the rounding ofvalue.timeUnitTimeUnitOne of the enumeration values that specifies the time unit of
interval.directionVerticalDirectionOne of the enumeration values that specifies the direction of the rounding.
Returns
Exceptions
- ArgumentOutOfRangeException
directionis an invalid enumeration value.
Round(TimeSpan, TimeSpan, VerticalDirection)
Returns a TimeSpan value that is rounded either towards negative infinity or positive infinity.
public static TimeSpan Round(this TimeSpan value, TimeSpan interval, VerticalDirection direction)
Parameters
valueTimeSpanA TimeSpan value to be rounded.
intervalTimeSpanThe TimeSpan value that specifies the rounding of
value.directionVerticalDirectionOne of the enumeration values that specifies the direction of the rounding.
Returns
Exceptions
- ArgumentOutOfRangeException
directionis an invalid enumeration value.