PHP, as most of us know, has weak typing. But what about those who don't require this. My problem is, here I have this code:
$total_price=0;
while(some condition)
{
//1st iteration
$total=0;
$total = number_format(2450.0000*1,4);
echo $total;//output-like 2,450.0000
$total_price +=number_format($total,4);
//2nd iteration
$total=0;
$total = number_format(1600.0000*2,4);
echo $total;//output-like 3,200.0000
$total_price +=number_format($total,4);
}
then echo $total_price;
is 5
....how?
apart from number_format()
here I want addition and multiplication of xxxx.0000,xxxx.0001
strictly have 4
decimal places e.g. 0.0000 + 0.0000 = 0.0000
not 0