In my application, I have a TextBlock that I display a Double number in after the user presses a button. This number can be a very small decimal or a very large number needing exponential notation (i.e. 3.43e12). The problem is, the program prints so many digits that it overflows my TextBlock and the user can't see all the valid information.
So how can I restrict the Double to print so to not overflow the TextBlock?
The code I am using to set the text is:
theTextBox.Text = (split * input).ToString();
EDIT: Someone asked for specific examples, so I thought I would clarify something. I basically want the string to never be longer than, say, 10 characters. That way it will fit in the TextBlock. I guess the trick is, when should those 10 characters be decimal places, whole numbers, or scientific notation that is the trick...