hi,
I want to sort this array of 55 numbers
when i use the code
Code:
//original = new Array();
original = [0.01, 0.01, 0.75, 1.00, 1.90, 0.35, 0.02, 0.35, 0.01, 1.00, 1.94, 5.00, 0.06, 0.40, 0.79, 0.01, 2.00, 7.00, 0.15, 0.41, 0.80, 1.10, 0.01, 8.55, 0.08, 0.50, 0.80, 1.52, 2.32, 21.00, 0.08, 0.50, 0.80, 1.25, 2.50, 0.12, 0.52, 0.85, 1.50, 2.60, 0.10, 0.60, 1.00, 1.75, 3.29, 0.22, 0.70, 1.00, 1.80, 2.50, 0.15, 0.72, 1.00, 1.85, 3.80];
sorted = new Array();
sorted = original.sort();
trace(sorted);
var i;
for (i=0; i<55; i++) {
result.addItem(sorted*);
}
the result i get is not properly sorted …to be more precise in the sorted output iam getting 21.00 right after 2.60 where as it shud come only in the end…
I have 2 doubts
- are the array elements considered as strings?
- Can we declare an array of type float??
Can anybody help??