Hi there, I'm looking to trim a randomly generated number down to a whole number.
I've tried various means but none seem to work. My latest attempt is as follows:
def som = Math.random() * totalContacts
log.info som
som.toInteger()
log.info som
def cleaned = parseInt(som)
log.info cleaned
(I'm logging to the console after each step just to check my results. )
I get the following error when I execute the above code -
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)
Thanks, Richard