title: Convert String to Float or Int in KOTLIN
body: <p>I need to convert app version to <code>Int</code> or <code>Float</code> for comparison.
  I am using the following syntax, but it throws <code>java.lang.NumberFormatException</code>.</p>
  
  <pre><code>val currentVersion = BuildConfig.VERSION_NAME.toFloat()
  </code></pre>
  
  <p><strong>Edit:</strong> What if I need to convert "2.2" to float? </p>