File

util/mathcompat.lua @ 12865:e6324117f124

mod_admin_shell: Add muc:occupants(room) command to list occupants Easier than going trough muc:room():each_occupant() since you have to do fiddly things to reach the print() function.
author Kim Alvefur <zash@zash.se>
date Sun, 29 Jan 2023 17:41:08 +0100
parent 12782:8815d3090928
line wrap: on
line source

if not math.type then

	local function math_type(t)
		if type(t) == "number" then
			if t % 1 == 0 and t ~= t + 1 and t ~= t - 1 then
				return "integer"
			else
				return "float"
			end
		end
	end
	_G.math.type = math_type
end