Rounding random number

Hi there. I am trying to round a random number I previously generated. Specifically, I am generating a random number between 2000 and 5000 as such:


I am now trying to round the number that is generated to the nearest multiple of 250.
To do so I was planning to divide the random number by 250, round it to the closest integer and then multiply it again by 250.

However, when I try to run: (int)Math.Round(random/250) it gives me an error (cannot convert random to decimal). Any idea on how to solve this? Thanks a lot!

The error message was probably different: “Cannot convert from double? to decimal”.

Use the following expression instead:

(int)Math.Round(random.Value / 250) * 250

Thanks a lot!!! It worked