title: GROOVY How to trim a random number into a whole number
body: <p>I'm looking to trim a randomly generated number down to a whole number. </p>
  
  <p>I've tried various means but none seem to work. My latest attempt is as follows:</p>
  
  <pre><code>def som = Math.random() * totalContacts
  log.info som 
  som.toInteger()
  log.info som
  def cleaned = parseInt(som)
  log.info cleaned 
  </code></pre>
  
  <p>(I'm logging to the console after each step just to check my results. )</p>
  
  <p>I get the following error when I execute the above code - </p>
  
  <blockquote>
    <p>groovy.lang.MissingMethodException: No
    signature of method:
    Script69.parseInt() is applicable for
    argument types: (java.lang.Double)
    values: [44.405365593296] Possible
    solutions: print(java.lang.Object),
    print(java.io.PrintWriter),
    print(java.lang.Object)</p>
  </blockquote>
  
  <p>Thanks,
   Richard</p>