Wow great work!

Just wanted to add. I only wanted to strip out the $ sign if entered, so I just added this line.

$price_out = ereg_replace("[$]", "", $price_out);