prototype Posted September 19, 2019 Share Posted September 19, 2019 Merhaba arkadaşlar hayırlı akşamlar... Ben alt taraftaki kod ile tcmb'den döviz kuru çekiyorum ancak döviz kurunu ürün fiyatıyla çarpmak istediğimde problem oluyor. Problem atıyorum döviz 5.71 ken çarpma işlemi sırasında sadece 5 ile çarpıyor noktadan sonrasını görmüyor problem nedir çözemedim.. Döviz kurunu çekme kodu; <?php $open = simplexml_load_file('http://www.tcmb.gov.tr/kurlar/today.xml'); // dolar $usd_alis = $open->Currency[0]->BanknoteSelling; echo 'USD: '.$usd_alis; ?> Çarpma işlemi kodu; <?php $sayi1=$usd_alis; $sayi2=145; $toplam=$sayi1*$sayi2; echo $toplam; ?> Quote Link to comment Share on other sites More sharing options...
Administrator sk8er_boi Posted September 20, 2019 Administrator Share Posted September 20, 2019 Burada doğru çalışıyor kodun. Please register to see this content. Değişkenlerini önce float tipinde tanımlamayı dener misin? $usd_alis = 0.00; 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.