title: Grouping Collection separating numeric 5 from String "5"
body: <p><strong>BackGround:</strong> I have an advanced data grid. The data provider for this ADG is an ArrayCollection. There is a grouping collection on an ID field of this AC. </p>
  
  <p>Example of a couple items within this AC the AC var name is "arcTemplates":</p>
  
  <pre><code>(mx.collections::ArrayCollection)#0
    filterFunction = (null)
    length = 69
    list = (mx.collections::ArrayList)#1
      length = 69
      source = (Array)#2
        [0] (Object)#3
          abbreviation = "sore-throat"
          insertDate = "11/16/2009"
          name = "sore throat"
          templateID = 234
          templateType = "New Problem"
          templateTypeID = 1
       [32] (Object)#35
          abbreviation = 123
          insertDate = "03/08/2010"
          name = 123
          templateID = 297
          templateType = "New Problem"
          templateTypeID = 1
       [55] (Object)#58
          abbreviation = 1234
          insertDate = "11/16/2009"
          name = 1234
          templateID = 227
          templateType = "Exam"
          templateTypeID = 5
       [56] (Object)#59
          abbreviation = "breast only"
          insertDate = "03/15/2005"
          name = "breast exam"
          templateID = 195
          templateType = "Exam"
          templateTypeID = 5
  </code></pre>
  
  <p>Example of Flex code leading to the Grouping:</p>
  
  <pre><code>&lt;mx:AdvancedDataGrid displayItemsExpanded="true" id="gridTemplates"&gt;
    &lt;mx:dataProvider&gt;
      &lt;mx:GroupingCollection id="gc" source="{arcTemplates}"&gt;
        &lt;mx:Grouping &gt;
          &lt;mx:GroupingField name="templateTypeID" compareFunction="gcSort"&gt;
  </code></pre>
  
  <p>GC sort function:</p>
  
  <pre><code>public function gcSort(a:Object, b:Object):int{
      return ObjectUtil.stringCompare(String(a.templateTypeID + a.name).toLowerCase(), 
                                      String(b.templateTypeID + b.name).toLowerCase());
  }
  </code></pre>
  
  <p><strong>Problem:</strong> In my AC example there are a few items, items 0, 32 and 56 properly sort and group to their templateTypeID, but item 55 does something weird. It seems to sort/group on the numeric 5 instead of the string "5". Gets stranger. If I change the name property to contain text (so 1234x) it then correctly sorts/groups to the string "5"</p>
  
  <p><strong>Question:</strong> What is going on here and how do I fix it?</p>