Click here to Skip to main content
15,920,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi i have a number that is double and want to display this number on textbox as double, for example "25.8". what shall i do?
Posted
Comments
Richard C Bishop 29-Oct-13 11:55am    
Well, I would start by adding that value to the Text property of the textbox.

Um, something like this maybe?

yourTextBox.Text = doubleValue.ToString();
 
Share this answer
 
Comments
mohsenvasefi 29-Oct-13 12:04pm    
thanks
Richard C Bishop 29-Oct-13 12:04pm    
You are welcome!
Try:
C#
myTextBox.Text = myDouble.ToString();
Or
C#
myTextBox.Text = myDouble.ToString("F1");
to fix the number of decimal places at 1
 
Share this answer
 
Comments
mohsenvasefi 29-Oct-13 12:04pm    
thanks alot
OriginalGriff 29-Oct-13 12:38pm    
You're welcome!
my problem was it couldn't display double number, i've solved it by divide to a double or float number as "10.0". before this, i watched just 497.00, not 497.16!! again, i should thank to OriginalGriff and richcb
 
Share this answer
 

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