Click here to Skip to main content
15,890,512 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
code for converting string to double in textbox using C#
Posted
Comments
Sandeep Mewara 3-Jul-12 5:44am    
No effort at all and asking for code. You need to read and learn such basic stuff.
lukeer 3-Jul-12 5:46am    
the bare minimum of politeness

You could start using at least one complete sentence.

What about: double.Parse[^] method?
 
Share this answer
 
Comments
Espen Harlinn 3-Jul-12 16:44pm    
5'ed!
Zoltán Zörgő 3-Jul-12 17:05pm    
Thank you
Please search it on Search Engines before asking such questions

C#
double d = Convert.ToDouble(txtBox.Text);
 
Share this answer
 
Comments
Espen Harlinn 3-Jul-12 16:44pm    
5'ed!
:doh:

It does not work like this here.

Here is what is expected of enquirers:
1. TRY first what you want to do! You may find that it's not that hard.
2. Formulate what was done by you that looks like an issue/not working.

Try them and tell if you face issues.



Start reading about Convert.ToDouble() and see if it helps.
 
Share this answer
 
Comments
Rahul Rajat Singh 3-Jul-12 6:13am    
I agree. +5 for proper guidance.
member60 3-Jul-12 6:47am    
+5
Espen Harlinn 3-Jul-12 16:44pm    
5'ed!
 
Share this answer
 
Comments
Espen Harlinn 3-Jul-12 16:44pm    
5'ed!
Shemeer NS 4-Jul-12 2:57am    
Thank You...
For example if you want to put your Double variable to Label this code will help:
C#
Label.Text = Convert.ToDouble(TextBox.Text).ToString();
 
Share this answer
 
Comments
[no name] 3-Jul-12 9:44am    
Why convert to a double only to turn it back to a string? That makes no sense at all.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900