Input string was not in a correct format

Hi
Can anyone help with the title problem

I have a currency column in the db, when I add it to the site page and convert it to decimal then submit the form I receive the error.

Input string was not in a correct format

the text box is: <%# Math.Round(Double.Parse(CustDetails.FieldValue("BidAmount", Container))).ToString("F") %>

I have no other server side code on the page.

Can anyone help with this problem
George
Tourist_SearchAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
David H.H.LeeConnect With a Mentor Commented:
Tourist_Search,
Try this :
<%# Math.Round(Double.Parse((CustDetails.FieldValue("BidAmount", Container)).ToString())).ToString("F") %>
0
 
AgariciCommented:
the error message simply states that the string CustDetails.FieldValue("BidAmount", Container) could not be parsed as a double

try to view the value of that column (display it in a message box for example)

hth.
A.
0
 
Tourist_SearchAuthor Commented:
Thanks x_com

You have had a busy day today

George
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

 
David H.H.LeeCommented:
Tourist_Search,
I'm glad if i could help.

x_com
0
 
TheAvengerCommented:
A little bit faster code would be:

<%# Math.Round(Convert.ToDouble (CustDetails.FieldValue("BidAmount", Container))).ToString("F") %>
0
 
Tourist_SearchAuthor Commented:
Thanks Avenger
I tried that but for some reason it would not work
George
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.