Compare value between Postgre Numeric with PHP variable
<p>I have a problem.</p>

<p>I store a number to Postgre database table named item:</p>

<pre><code>id | quantity
1 | 10.55
</code></pre>

<p>id is integer, and quantity is numeric</p>

<p>And now i have a PHP variable like this :</p>

<p>$quantity = 10.55;</p>

<p>And then i retrieve quantity data from item table :</p>

<pre><code>$sql = "select quantity from item where id = 1;";
</code></pre>

<p>And then cause i use CodeIgniter so i execute that query like this :</p>

<pre><code>$res = $this-&gt;db-&gt;query($sql)-&gt;result_array();
</code></pre>

<p>And then i compare both of them like this :</p>

<pre><code>if($res[0]['quantity'] != $quantity){
  echo(res[0]['quantity']." is different with ".$quantity);
}
</code></pre>

<p>And then the result is :</p>

<pre><code>10.55 is different with 10.55
</code></pre>

<p>I stuck with it. Why 10.55 is different with 10.55 ?</p>