The title speaks for itself, im attempting to use math.Random, however I need to use precise numbers and whenever I use the function it appears to 'simply' my numbers (i.e il give math.random 0, 5.3614139556885 as arguments, and il get back 3.) Is there any way to get more precise numbers from math.Random?
function RandomWithDecimals(x, y, decimalRange) return math.random(x * math.pow(10, decimalRange), y * math.pow(10, decimalRange))/math.pow(10, decimalRange) end print(RandomWithDecimals(1, 10, 5))
You do math.random normally except there is a third argument which is a decimal range. That is how many digits you want your decimal to have. What I mean is like: 0.2398 has a decimal range of 4, 0.239888 has a decimal range of 6, 0.1 has a decimal range of 1