title: How to read a PHP variable as a numeric variable to make some calculation?
body: <p>I am having problems with a variable which reads 17,50 for calculation. The variable is part of an array and i am just getting the value 17.00</p>
  
  <pre><code>$product_price_tmp = intval(str_replace(",",".",$custom_values['product_price'][0]));
  </code></pre>
  
  <p>and i tried the following</p>
  
  <pre><code>$product_sub_total = sprintf("%.2f",$product_price_tmp);//reads 17.00
  $product_sub_total = $product_price_tmp;//reads 17
  </code></pre>
  
  <p>I didn't notice the problem as all my test price values were rounded numbers.</p>
  
  <p>Any tips?</p>