Table of Contents

Round Method

Definition

Namespace
Cuemon.Extensions
Assemblies
Cuemon.Extensions.Core.dll
Source
src/Cuemon.Extensions.Core/TimeSpanExtensions.cs

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

value TimeSpan

A TimeSpan value to be rounded.

interval double

The double value that in combination with timeUnit specifies the rounding of value.

timeUnit TimeUnit

One of the enumeration values that specifies the time unit of interval.

direction VerticalDirection

One of the enumeration values that specifies the direction of the rounding.

Returns

TimeSpan

A TimeSpan value that is rounded either towards negative infinity or positive infinity.

Exceptions

ArgumentOutOfRangeException

direction is 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

value TimeSpan

A TimeSpan value to be rounded.

interval TimeSpan

The TimeSpan value that specifies the rounding of value.

direction VerticalDirection

One of the enumeration values that specifies the direction of the rounding.

Returns

TimeSpan

A TimeSpan value that is rounded either towards negative infinity or positive infinity.

Exceptions

ArgumentOutOfRangeException

direction is an invalid enumeration value.