AMPScript is loosely typed. You may want to utilize the AttributeValue() functionsAttributeValue() function so you can detect empty values in either number (using the empty() function). Here's how I would do to it:
%%[
var @price, @qty, @extPrice
/*
set @price = AttributeValue("price")
set @qty = AttributeValue("qty")
*/
set @price = "12.34"
set @qty = "3"
if empty(@price) or empty(@qty) then
set @extPrice = "0.00"
else
set @extPrice = multiply(@price,@qty)
endif
]%%
<br>extPrice: %%=formatNumber(@extPrice,D2)=%%
Output
extPrice: 37.02
Reference