title: How to calculate number of digits after floating point in iOS?
body: <p>How can I calculate the number of digits after the floating point in iOS?</p>
  
  <p>For example:</p>
  
  <ul>
  <li>3.105 should return 3</li>
  <li>3.0 should return 0</li>
  <li>2.2 should return 1</li>
  </ul>
  
  <p><strong>Update:</strong>
  Also we need to add the following example. As I want to know number of digits in the fraction part.</p>
  
  <ul>
  <li>1e-1 should return 1</li>
  </ul>