# Array sort

**URL:** <https://forum.kirupa.com/t/array-sort/43926>\
**Category:** flash\
**Created:** [February 27, 2004, 3:58am UTC](https://forum.kirupa.com/t/array-sort/43926 "2004-02-27T03:58:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandyas](https://avatars.discourse-cdn.com/v4/letter/s/3ab097/32.png) [@sandyas](https://forum.kirupa.com/u/sandyas)\
**Post date:** [February 27, 2004, 3:58am UTC](https://forum.kirupa.com/t/array-sort/43926/1 "2004-02-27T03:58:52Z")

</div>

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

1. are the array elements considered as strings?
2. Can we declare an array of type float??

Can anybody help??
