المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Rounding statement not working in C# program



C# Programming
03-27-2009, 11:12 PM
I have a program that contains a “start time” and “end time” to equal TempHours
I would like dHours to be the rounded figure.
I am trying to round the number up to next tenth of an hour
(IE 4.11 hours is 4.2 hours but 4.10 hours stays at 4.1 hours)

What do I need to add to the below statement to get it working

decimal dHours = Math.Round(decimal.Parse(TempHours.ToString()),3);

Thanks