I take the difference between two DateTime fields, and store it in a TimeSpan variable, Now I have to round-off the TimeSpan by the following rules:
if the minutes i
How about:
public static TimeSpan Round(TimeSpan input) { if (input < TimeSpan.Zero) { return -Round(-input); } int hours = (int) input.TotalHours; if (input.Minutes >= 30) { hours++; } return TimeSpan.FromHours(hours); }