File

util/mathcompat.lua @ 13042:0f05804e974d

mod_admin_shell: Make default column width 1 part These gets used for usernames, resources and other random session fields that don't have a column definition in `available_columns`
author Kim Alvefur <zash@zash.se>
date Fri, 07 Apr 2023 13:07:00 +0200
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