title: Easier way to prevent numbers from showing in exponent notation
body: <p>I'm going to rely on the saying that no question is a dumb question, but I have a slightly dumb one to ask.</p>
  
  <p><strong>EDIT:</strong></p>
  
  <p>Seems that this question has been asked and answered a few times on here already, though using titles I didn't come across when searching for duplicates.  Here are some related posts:</p>
  
  <ol>
  <li><a href="https://stackoverflow.com/questions/1546113/double-to-string-conversion-without-scientific-notation">Double to string conversion without scientific notation</a></li>
  <li><a href="https://stackoverflow.com/questions/1319191/how-to-convert-double-to-string-without-the-power-to-10-representation-e-05">How to convert double to string without the power to 10 representation (E-05)</a></li>
  <li>Place with an answer (Jon Skeet): <a href="http://www.yoda.arachsys.com/csharp/DoubleConverter.cs" rel="nofollow noreferrer">http://www.yoda.arachsys.com/csharp/DoubleConverter.cs</a></li>
  </ol>
  
  <hr>
  
  <p><em>Original Question:</em></p>
  
  <p>I've got an app that sometimes stores some decently small numbers, such as <code>0.000023425</code>.  These numbers get loaded up in <code>TextBox</code> controls for users to edit.  The following contrived example shows my issue:</p>
  
  <pre><code>Dim number As Double = 0.000023425
  someTextBox.Text = number.ToString() ' Shows "2.3425E-05"
  </code></pre>
  
  <p>As mentioned, the text that shows is <code>2.3425E-05</code>, which isn't exactly intuitive for the user to see, plus I have numbers even more precise (out to 19 decimal places). I would like the output to be fixed point. Of course I could easily and cleanly do:</p>
  
  <pre><code>number.ToString("F20") ' Shows "0.00002342500000000000"
  </code></pre>
  
  <p>But then there's an annoying number of zeros left over.  So, to fix that, I could do:</p>
  
  <pre><code>number.ToString("#,##0.####################") ' Shows "0.000023425"
  </code></pre>
  
  <p>Which is what I want, but is there any better way to do it than to have that giant ugly format string there?  So, ok, it's not that ugly, but surely there's a different way, right? My goal is to show the raw value being stored in the DB in a friendly way, and I would rather not have to force a format on the number at all.</p>
  
  <p>Thanks!</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>Perhaps I said a bit too much in the post.  After some experimentation, I found that changing the underlying datatype to <code>Decimal</code> solves the issue.</p>
  
  <pre><code>Dim number As Decimal = 0.000023425
  someTextBox.Text = number.ToString() ' Shows "0.000023425" instead of "2.3425E-05"
  </code></pre>
  
  <p>So it sounds like <code>Double</code>s aren't precise enough to be displayed normally?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I <a href="https://stackoverflow.com/questions/1319191/how-to-convert-double-to-string-without-the-power-to-10-representation-e-05/1546440#1546440">found a post</a> (albeit with no upvotes) that simply casts the the Double value as a Decimal before doing a <code>.ToString()</code> on it, which has the desired effect.  Is there any reason why I wouldn't want to do that?  Perhaps the cast to <code>Decimal</code> has the potential to end with a different value than the <code>Double</code> (even though it's a negligible amount), so perhaps the <code>#,##0.#################...</code> format string is safer.</p>