PHP not support double
<p>Hi I have written one function which is giving diff out put in PHP and JAVA. Please help me to get same output in PHP too. below are that functions written in both languages.</p>

<p>function in JAVA </p>

<pre><code>public String getLat(String v_str, String strNS){
   try
   {            
       double lat = Integer.parseInt(v_str.substring(0, 2));
       //System.out.println("lat="+lat);
       double lat2 = Float.parseFloat(v_str.substring(2));
       lat2 = lat2*10000;
       lat2 = lat2/60*10000;
       lat2 = lat2/100000000;
       //System.out.println("lat2="+lat2);
       lat += lat2;

       if(strNS.equals("S"))
            return ("-"+lat);
       else
            return (""+lat);
   }
   catch(Exception e){}

   return ("");
}
</code></pre>

<p>CALL : getLat("5224.09960","N");</p>

<p>OUTPUT: 52.40165999730428</p>

<p><strong>function in PHP</strong></p>

<pre><code>$deg_coord = '5224.09960';

$lat = (int)(substr($deg_coord,0,2));
$lat2 = (substr($deg_coord,2));

$lat2 = $lat2*10000;
$lat2 = $lat2/60*10000;
$lat2 = $lat2/100000000;
echo $lat += $lat2;
exit;
</code></pre>

<p>OUTPUT:52.40166</p>
