Currently working on fixing a speed radar script below is what I have to catch speed
local TargetVehicleInfo = { Name = GetDisplayNameFromVehicleModel(GetEntityModel(TargetVehicle)), Plate = GetVehicleNumberPlateText(TargetVehicle), Speed = (GetEntitySpeed(TargetVehicle)*2.23694), Insurance = GetVehicleInsurance(GetVehicleNumberPlateText(TargetVehicle)), Registration = GetVehicleRegistration(GetVehicleNumberPlateText(TargetVehicle)) }
My question is how do I round off the radar to the nearest whole number instead of going out like 10 decimal places like it currently is? This is what is there, is there anybody that can help me fix it by any chance? Thank you!
function RoundNumber(num, numRoundNumber)
local mult = 10^(numRoundNumber or 0)
return math.floor(num * mult + 0.5) / mult
end