round/decimal problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
itsmani1
Forum Regular
Posts: 791
Joined: Mon Sep 29, 2003 2:26 am
Location: Islamabad Pakistan
Contact:

round/decimal problem

Post by itsmani1 »

Code: Select all

$percent1 = $percent / 100;
	$temp = $price * $percent1;
	$price1 = $price-$temp;
	$price1 = round($price1, 2)
Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.= $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.cimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.e1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Pric $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing t $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
p;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.t to show 13.20 something like this..
------------
any suggestion plz.mp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.: $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.b6e851]
Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
wh1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showi $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.t / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoi = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2 $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.251]
Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.stion:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.on plz.emp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.$13.2
--------------
Question:
what its not sho/ 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two nt / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.owing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.ginal Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
$percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz. $percent1 = $percent / 100;
$temp = $price * $percent1;
$price1 = $price-$temp;
$price1 = round($price1, 2)

Out Put:
Original Price : $22.00
Discount : 40.00 %
Your Price : $13.2
--------------
Question:
what its not showing two decimal paoints in "13.2 "
Your Price : $13.2
i want it to show 13.20 something like this..
------------
any suggestion plz.
User avatar
Burrito
Spockulator
Posts: 4715
Joined: Wed Feb 04, 2004 8:15 pm
Location: Eden, Utah

Post by Burrito »

Post Reply