title: Casting to int in awk
body: <p>I'm looking for a method to cast a string to an int in awk. I have the following which appears to be doing a string comparison </p>
  
  <p>(<strong><em>note</strong>: field <code>$5</code> is a percentage in one of two formats: <code>80%</code> or <code>9.0%</code>)</em></p>
  
  <pre><code>awk '{if (substr($5,1,(length($5)-1)) &gt;= 90) ...
  </code></pre>
  
  <p>So, when I change it to:</p>
  
  <pre><code>awk '{if (substr($5,1,(length($5)-1))+0 &gt;= 90+0 ) ...
  </code></pre>
  
  <p>It compares as I intended.  Is this an appropriate cast?  Is there a 'better' way to perform the cast?</p>