Round Method
Definition
- Namespace
- Cuemon.Extensions
- Assemblies
- Cuemon.Extensions.Core.dll
Round(DateTime, double, TimeUnit, VerticalDirection)
Returns a DateTime value that is rounded either towards negative infinity or positive infinity.
public static DateTime Round(this DateTime value, double interval, TimeUnit timeUnit, VerticalDirection direction)
Parameters
valueDateTimeThe DateTime to extend.
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.- ArgumentOutOfRangeException
intervalis Zero.
Round(DateTime, TimeSpan, VerticalDirection)
Returns a DateTime value that is rounded either towards negative infinity or positive infinity.
public static DateTime Round(this DateTime value, TimeSpan interval, VerticalDirection direction)
Parameters
valueDateTimeThe DateTime to extend.
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.- ArgumentOutOfRangeException
intervalis Zero.