Link to home
Start Free TrialLog in
Avatar of Tourist_Search
Tourist_Search

asked on

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
Avatar of Agarici
Agarici
Flag of Romania image

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.
ASKER CERTIFIED SOLUTION
Avatar of David H.H.Lee
David H.H.Lee
Flag of Malaysia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tourist_Search
Tourist_Search

ASKER

Thanks x_com

You have had a busy day today

George
Tourist_Search,
I'm glad if i could help.

x_com
A little bit faster code would be:

<%# Math.Round(Convert.ToDouble (CustDetails.FieldValue("BidAmount", Container))).ToString("F") %>
Thanks Avenger
I tried that but for some reason it would not work
George