1
Follow the example of my code:
$v_quantidade = 10;
$v_preco = '3,68' ;
$v_total = $v_preco * $v_quantidade;
echo "$v_total";
My variable $v_quantity it brings whole number, example: 3.. 5..10.. 20.etc. ...
My variable $price brings the price, example: 3.68.
When I do the calculation shown above is returning wrong,that example calculation ai is returning 10.
What I’m doing wrong ?
And if possible also another doubt together, some prices may come like this: 3,689 as I present in php only 3.68
Comma is not decimal separator.
– rray
Comma calculation in PHP
– rray
@rray Good morning, I take this information from the bank and it comes this way,how could I treat ? Any tips?
– Chefe Druida
@Perfect rray, it worked. Just one more doubt,he returned like this: 36.8 how do I return so 36.80 ?
– Chefe Druida
With numberFormatter
– user28595
Number formatting
– rray
Thank you Diego F and rray, everything perfect.
– Chefe Druida