[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
**Subject**: **Re: math.max**
**From**: Luiz Henrique de Figueiredo <lhf@...>
**Date**: Mon, 1 Aug 2011 10:56:24 -0300

> I have a variable that contains numeric values separated by a comma, e.g.
> Values = "1, 7, 5". I want to figure out which value within that variable is
> the lowest and highest. The math.min and math.max functions seem most
> appropriate except that they wont accept a variable as an argument. Is this
> possible with the built in math functions or do I need to parse the variable
> and compare values with tonumber()?
min,max = loadstring("return math.min("..Values.."), math.max("..Values..")")()