double d = toDateTime.SelectedDateTime.Subtract(
servicefromDateTime.SelectedDateTime).TotalHours;
string s = String.Format("{0:0}",d);
But String.Format rounds the value: if d is 22.91, String.Format gives the result of rounding 23. I do not want to round. For example, if d is 22.1222222, then I want 22. if d is 22.999999, then I want 22.
How can i achieve this?
source
share