easy conversion problem for you :)

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply
User avatar
Posts: 826
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA

Sat Feb 15, 2003 9:02 am

Question #1

Code: Select all


the number represents how many decimal places you want.


Question #2

Code: Select all

echo "€/$".(substr($myrow["price"],1)*1.6)

Question #3

Code: Select all

$conversion = 1.6;
echo "€/$".(substr($myrow["price"],1)*$conversion);

you can then change $conversion at anytime. This way in 6 months you won't forget what the 1.6 was.

make sure you have any math function encapsulated with () if it is in the same line as your output.

BTW why are you calling a substr() function on the price? I would not reccomend including the "€/$" in the within the database.

Post Reply