In a column(quantity) I have some values of type double and N/A too . How to sort both using Comparator?
<p>In a column(quantity) I have some values of type double and N/A too.</p>

<p>In my comparator class compare method, this is the coding mentioned below</p>

<pre><code>   if(double1 == double2) {
        return 0;
    }

    // We know that both aren't null, so if only long 2 is null, 1 &gt; 2
    if(double2 == null) {
        return 1;
    }

    // We know that both aren't null, so if only long 1 is null, 1 &lt; 2
    if(double1 == null) {
        return -1;
    }

    // Nulls are handled, use the native compare
    return double1.compareTo(double2);
</code></pre>

<p>double1 and double2 is of type Double.</p>

<p>It gives Exception: java.lang.NumberFormatException: For input string: "N/A" .</p>

<p>Please give me the solution.</p>
