title: Get the product raw price for display (float) on WooCommerce cart page
body: <p>I am using WooCommerce with Dokan plugin. I need to convert the string to a number so that I can use it for calculations <em>(this has to be easier than I am making it)</em>.</p>
  <p>I need to use the line subtotal rather than the product price because the product price is pulling back the lowest variable product price instead of the the option they selected.</p>
  <p>I have tried <code>ltrim()</code> and <code>substring()</code>, the number is correct but it's returning it formatted and I can't figure out how to get rid of the currency symbol ($) and make it as a float number.</p>
  <pre><code>
  foreach ( WC()-&gt;cart-&gt;get_cart() as $cart_item_key =&gt; $cart_item ) {
     $product = $cart_item['data'];
     $product_id = $cart_item['product_id'];
      /*?&gt;Product ID:  &lt;?php  echo $product_id,&quot;&lt;br&gt;&quot;; */
     $quantity=1;
     
      $quantity = $cart_item['quantity'];
      ?&gt;Quantity:  &lt;?php  echo $quantity,&quot;&lt;br&gt;&quot;; 
      
  /*  $price = WC()-&gt;cart-&gt;get_product_price( $product );
      ?&gt;Total Price 1:  &lt;?php  echo $price,&quot;&lt;br&gt;&quot;; */
      
      //$price = get_post_meta($cart_item['product_id'] , '_price', true);
      
      $price = WC()-&gt;cart-&gt;get_product_price( $product );
      ?&gt;Price:  &lt;?php  echo $price,&quot;&lt;br&gt;&quot;; 
      
      $res = ltrim($price,12);
  
      ?&gt;Price:  &lt;?php  echo $res,&quot;&lt;br&gt;&quot;; 
      
      
      
      $item_total = $price * $quantity;    
      ?&gt;Item Total:  &lt;?php  echo $item_total,&quot;&lt;br&gt;&quot;;
      
  
      
      $vendor_id = get_post($product_id); 
      /*?&gt;Vendor ID: &lt;?php echo $vendor_id-&gt;post_author,&quot;&lt;br&gt;&quot;; */
      $admin_commission  = get_user_meta( $vendor_id-&gt;post_author, 'dokan_admin_percentage', true );
     ?&gt;Admin Commission: &lt;?php echo $admin_commission, &quot;&lt;br&gt;&quot;;
      $commission_amount = number_format(($price) * ( (get_user_meta( $vendor_id-&gt;post_author, 'dokan_admin_percentage', true ))/100),2);
      $commission_total = ($commission_amount/2);
      ?&gt;Commission_Total: &lt;?php echo $commission_total,&quot;&lt;br&gt;&lt;br&gt;&quot;;
      $amt_raised_for_cause= $amt_raised_for_cause + $commission_total ;
     // Anything related to $product, check $product tutorial
     //$meta = wc_get_formatted_cart_item_data( $cart_item );
   
  }
  
  </code></pre>