1
I have that value: 250,59
and that other value: 20,19
when we both go,: 270
Follow my calculations:
$mo = $vl_mobra ; //VALOR 1 250,59
$mt = $vl_mat; //VALOR 2 20,19
$vt = $mo + $mt; //SOMA
See more examples:
20.000,66 //VALOR 1
10.000,99 //VALOR 2
30 // TOTAL
500,99 //VALOR 1
100,88 //VALOR 2
600 //TOTAL
function moedaPhp($str_num){
$vt = str_replace('.', '', $str_num);
$vt = str_replace(',', '.', $vt);
return $vt;
}
echo moedaPhp($vt);
i put your function, more returned the same way, edited the question with the function,see if I did wrong.
– Chefe Druida
See updated example, lacked floatval in function.
– Allan Andrade
Perfect, Thank you !
– Chefe Druida
I’m glad I could help!
– Allan Andrade