String Interpolation
You can use string.format. A lot of people actually don't know this, but the format function can define the precision of any given number, given some float, to however many decimal places you want. Here's an example...
local function round_number(n, places)
return tonumber(string.format("%." .. (places or 0) .. "f", n))
end
The format goes as follows: %. says that you are looking for precision, .. places .. is an integer specifying how precise the number should be, f says it's a float. You would call it as such...
round_number(10.9482, 2)
10.95
I don't have a lot of time right now, so I'm not able to add more telling details to my answer. However, you can read more about it for yourself on this wiki page, and I'm sure you can find more information about format on google or this website. I'd also recommend learning what a floating point number is, just for extra information if you're interested.