Jump to content

php not multiply


Salvis

Recommended Posts

I have code:

   <?php
$_GET["price"]="3.13";
$_GET["currency"]="EUR";
         if($_GET['currency']!="LVL"){
            $bank=simplexml_load_file('http://valutas.info/xml/'.$_GET["currency"]);
                foreach ($bank->item->rates as $item)
                        echo "Kurss: ".$item->sellInCash."<br />";
                        echo "Cena: ".$_GET['price']."<br />";
                        $kaka=$_GET['price']*$item->sellInCash;
                        echo "Reizinasana: ".$kaka."<br />";
                        $tests1="0.7028000000000";
                        echo "Tests: ".$_GET["price"]*$tests1."<br />";

                    }            
            }
?>

I noticed that

$_GET['price']*$item->sellInCash

gives out 0

but

$_GET["price"]*$tests1

returns all correct.

Why? Where is mistake?

 

Link to comment
https://forums.phpfreaks.com/topic/193659-php-not-multiply/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.