TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Callie
NA
4
3k
C# asp.net. Trying to convert TimeSpan into Decimal
Apr 23 2014 3:47 PM
I have the following code to add weekly timesheet (time) values to produce the weeks total
But I need to convert the outcome (lblTotal) to decimal and place in txtTotal
TimeSpan duration = TimeSpan.Parse(lbl1.Text).Add(TimeSpan.Parse(lbl2.Text).Add(TimeSpan.Parse(lbl3.Text).Add(TimeSpan.Parse(lbl4.Text).Add(TimeSpan.Parse(lbl5.Text).Add(TimeSpan.Parse(lbl6.Text))))));
lblTotal.Text = "" + (duration);
I have tried the following:
txtTotal.Text = Convert.ToDecimal(duration).ToString("#.00");
but no matter how I change it around keep getting the
System.TimeSpan' to type 'System.IConvertible error
Any help would be great
Reply
Answers (
2
)
update row from datagridview to database
Address Book project problem (listView)