title: How to compare two "numbers" with multiple dots?
body: <p>I have an unordered list that can look something like this:</p>
  
  <p>1
  <br>
  2.2
  <br>
  1.1.1
  <br>
  3</p>
  
  <p>When i sort the list, 1.1.1 becomes greater than 3 and 2.2, and 2.2 becomes greater than 3.</p>
  
  <p>This is because Double.Parse removes the dots and makes it a whole number.</p>
  
  <p>This is the method i use to sort with: </p>
  
  <pre><code>public class CompareCategory: IComparer&lt;Category&gt;
  {
      public int Compare(Category c1, Category c2)
      {
          Double cat1 = Double.Parse(c1.prefix);
          Double cat2 = Double.Parse(c2.prefix);
  
          if (cat1 &gt; cat2)
              return 1;
          else if (cat1 &lt; cat2)
              return -1;
          else
              return 0;
      }
  }
  </code></pre>
  
  <p>How can i fix this?
  Thanks</p>