title: How can I deformat string with prices in python?
body: <p>I got db where one of the field in record in table contain prices in form of string.
  String itself is not a big deal - but price is totally unformatted:</p>
  
  <pre><code>$12,000.50
  $3.50
  From $3.50 to $12,000.50
  </code></pre>
  
  <p>what I trying to get is:</p>
  
  <pre><code>12000.50
  3.50
  3.50
  </code></pre>
  
  <p>strip it from all "$" and "," and leave only first digit of two</p>
  
  <p>I made this code and it works for first to examples but fail for last one (sqlite syntax error - obviosly it gives me both digits)</p>
  
  <p>Here is code:</p>
  
  <pre><code>for every_line:
             found=re.findall(r"\d.\.?",every_line[9])
             db_cursor.execute("UPDATE MAINTABLE SET Price="+"".join(found)+" WHERE Id="+str(every_line[0]))
  db_connection.commit()
  </code></pre>
  
  <p>where every_line[0] is index field and [9] is price field</p>
  
  <p>How can I make it more efficient (with or without regex), simpler  and more universal ? </p>
  
  <p>Thank You in advance</p>