title: How to show only trailing decimals if they are all not zeros?
body: <p>I want to convert the value of a decimal to a string, but only show the trailing decimals if they're not all zeros. e.g. 
  <code>nice_decimal_show(Decimal("3.00")) == "3" nice_decimal_show(Decimal("3.14")) == "3.14"</code></p>
  
  <p>What would be the canonical way of doing this?</p>
  
  <p>Right now I'm doing:</p>
  
  <pre><code>format_decimal_to_integer_string_if_possible(Decimal("3.000")) "3" &gt;;&gt;;&gt;; format_decimal_to_integer_string_if_possible(Decimal("3.400")) "3.400" """ assert isinstance(decimal, Decimal) integral = decimal.to_integral() if integral == decimal: return str(integral) else: return str(decimal) ```
  </code></pre>