Probably more than you want to know, but...
There are four functions for converting doubles to integers: truncate, floor, round and ceiling.
"truncate" returns the integer with the fractional part dropped (rounded toward 0).
truncate(3.1) = 3
truncate(3.5) = 3
truncate(3.7) = 3
truncate(4.0) = 4
truncate(-3.1) = -3
"floor" returns the integer that is less than or equal to the value passed (rounded toward negative infinity):
floor(3.1) = 3
floor(3.5) = 3
floor(3.7) = 3
floor(4.0) = 4
floor(-3.1) = -4
"ceiling" returns the integer that is greater than or equal to the value passed (rounded toward infinity):
ceiling(3.1) = 4
ceiling(3.5) = 4
ceiling(3.7) = 4
ceiling(4.0) = 4
ceiling(-3.1) = -3
"round" returns the integer which is the double value rounded toward 0 if fractional part is < 0.5, otherwise away from 0:
round(3.1) = 3
round(3.5) = 4
round(3.7) = 4
round(4.0) = 4
round(-3.1) = -3
round(-3.5) = -4
(I hope I got all those right.)
So for your GetRandomInt case, assuming the number is always greater than 0, you could use truncate or floor. I assume if the value is 3.5, you don't want the random numbers to go up to 4...
There is also a cast operator, but you can explore that on your own (or ask me, if you're really curious).