order_of_magnitude = function(n)
	return math.floor(math.log(n)/math.log(10))
end