This is how it works with your test command

function round(num, numDecimalPlaces)
    local mult = 10^(numDecimalPlaces or 0)
    return math.floor(num * mult + 0.5) / mult
end

RegisterCommand("test", function(source, args, rawCommand) 
    local input = tonumber(args[1])
    local rounded = round(input, 3)
    print(rounded)
end, false)