Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

Math with decimal is not working

$
0
0
hi guys,

i have a function from Brazilian´s mail company, that calculates the shipping cost from a product,

function calcula_frete($servico,$CEPorigem,$CEPdestino,$peso,$altura='3',$largura='25',$comprimento='30',$valor='1.00')

// Using this example
$price= return $this->calcula_frete("40010",$this->cep_origem,$this->cep,$soma); 




using this $price = R$14,90, the product price is R$100, but when i do
$total = $price + $product; // 14,90 + 100
echo $total;



it shows 114 instead of 114,90.

i tried to do (100,00 + 14,90) , (100.00 + 14,90) but is returns the same thing, 114.

what could be happening?

Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>