title: Remove Trailing Zeros from a Double Value
body: <p>I have encountered a problem in a solution that I am trying to achieve, namely I need to be able to remove trailing zeros from a double value using <code>C#</code>. </p>
  
  <p>For instance, if I were creating two objects that represent a formula, it would be appropriate to say that the two formulas <strong>(2.0 + 7)</strong> and (2.000 + 7) are <em>equivalent</em>. That is,  <code>(2.0 + 7) == (2.00000 + 7)</code>. However, I'm not sure the best way to approach this is. I'm thinking regular expressions, but I'm not certain that I can get the outcome I am looking for.</p>
  
  <p>It seems that there would be an issue with <code>resolution</code> in this case. As an example, the two formulas 2.0 + 7 and 2.000000001 + 7 aren't the same, but they are extremely close. So my question is, could a regular expression account for this? Likewise, would a regular expression be the best approach?</p>
  
  <p>With more elaboration, the following should be legal.</p>
  
  <pre><code>Assert.IsTrue(new Formula("2.0 + x7").Equals(new Formula("2.000 + x7")))
  </code></pre>
  
  <p>Within the <code>Formula</code> class there is a field that stores reference to a <code>List</code> of strings. This list must contain the same value in order for the overridden "Equals" method to return true.</p>