p5.js changing data types (from float into int)

Hey! I've started using p5.js after using processing, and so I am stuck trying to change a float into an int.

I want to get a random integer so I can upload a random image: // get a random number for image var imgNum; function setup(){ imgNum = random(0, 14); }

How would I go about converting the random number into an int?



Sign In or Register to comment.