convert .Text to double

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • help1267
    New Member
    • Aug 2006
    • 10

    #1

    convert .Text to double

    I'm trying to convert an entry from a form text box to a double and am always getting "Input string was not in the correct format".

    This is my code:

    dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);

    If I hardcode:

    dblAmount = double.Parse("1 0000");

    it works


    Do you know what I'm overlooking with my initial statement:
    dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);

    Thx for your help.
  • vee10
    New Member
    • Oct 2006
    • 141

    #2
    hi,

    I think u should write as

    dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text.ToStrin g());












    Originally posted by help1267
    I'm trying to convert an entry from a form text box to a double and am always getting "Input string was not in the correct format".

    This is my code:

    dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);

    If I hardcode:

    dblAmount = double.Parse("1 0000");

    it works


    Do you know what I'm overlooking with my initial statement:
    dblAmount = double.Parse(fr m_aTest.txtAmou nt.Text);

    Thx for your help.

    Comment

    Working...