Hi there,
I have an array that contains numbers
one problem with the sorting is that its does not read the whole value example
1.0
2.10
3.2
this is the result of sorting.
what i want is
2.2
3.10
Any idea how to accomplish it?
Thanks
Say, this '1.0'
1 is a value on (0,0) ?
0 is a value on (0,1) ?
or '2.10'
2 is a value on ((1,0) ?
10 is a value on ((1,1) ?
or does the 2 in '2.10' just stands for the X index and 10 is the value on that index ?
sebastiangohhy
You have to zero pad numbers if you want them to sort properly - the array sort does a text based sort.
so, when you put a number into the array use zeropad(number,digits)
when you need to use then number later, convert it back to a number using int(arrayvalue) or float(arrayvalue)...
Develop games in your browser. Powerful, performant & highly capable.
AllanR
THANK YOU, exactly what i needed