title: How to get number of decimal places
body: <p>How would I do the following:</p>
  
  <pre><code>&gt;&gt;&gt; num_decimal_places('3.2220')
  3 # exclude zero-padding
  
  &gt;&gt;&gt; num_decimal_places('3.1')
  1
  
  &gt;&gt;&gt; num_decimal_places('4')
  0
  </code></pre>
  
  <p>I was thinking of doing:</p>
  
  <pre><code>len((str(number) if '.' in str(number) else str(number) + '.').rstrip('0').split('.')[-1])
  </code></pre>
  
  <p>Is there another, <strong>simpler</strong> way to do this?</p>