--- Cesar Aracena <[EMAIL PROTECTED]> wrote: > I get two numbers from a FORM, one price and one > quantity and I need to make a multiplication with > them in order to store the total amount also as a > double expression... I'm trying with: > > $totalprice = $price * $qty; > > but when I echo the, it gives me just plain old 0 > (zero). Any suggestions?
Without seeing more code, it is hard to say, but I imagine $qty and/or $price are not what you think they are. Here is a little example that you might find useful: <? $price = "3.50"; $quantity = 5; $total = $price * $quantity; echo "$total\n"; printf("$%.2f", $total); ?> Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php