mjesteve opened a new issue #1100:
URL: https://github.com/apache/royale-asjs/issues/1100


   When I try to sort an ArrayView by a string field, numerically, it doesn't 
work. 
   Reviewing previous issues I have seen that this same problem existed with 
the compareAsNumber()  method (called from sort()) [1] and it was solved by 
typing the values to number [2]. Could we do the same with the compareNumber() 
method (called from sortOn())?
   
   For example:
   ```
   private static function compareNumber(a:Object, b:Object):int
           {
               for each(var n:String in sortNames)
               {
                   if (Number(a[n]) > Number(b[n]))
                   {
                       return muler;
                   } else if (Number(a[n]) < Number(b[n]))
                   {
                       return -muler;
                   }
               }
               return 0;
           }
   ```
   
   [1] Sorting arrays with Array.NUMERIC not working correctly [#900]
   [2] Fix arrays not sorted numerically #900 [#902]
   
   Could you send the modification by PR?
   
   Thx.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to