title: PHP calculation result not showing correct currency format
body: <p>In the following code I am trying to get the results:</p>
  
  <pre><code>$time_base_cost_day;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>$time_base_cost_month;
  </code></pre>
  
  <p>to show with correct currency comma separators like <code>$1,456.00</code> or <code>$100,456.00</code></p>
  
  <p>I have tried a couple of examples but not sure where I am not adding the function correctly. </p>
  
  <p>Thank you for your help</p>
  
  <pre><code>&lt;?php 
    $choose_industry = $_POST['choose_industry'];
    $company_name = $_POST['company_name'];
    $hourly_rate = $_POST['hourly_rate'];
    $billable_rate = $_POST['billable_rate'];
   $working_days = $_POST['working_days'];
   $wasted_time_per_day = $_POST['wasted_time_per_day'];
    $no_of_trucks = $_POST['no_of_trucks'];
   $fuel_price_per_liter = $_POST['fuel_price_per_liter'];
   $fuel_wasted_per_hr = $_POST['fuel_wasted_per_hr'];
  
   $time_base_cost_day = $hourly_rate*$wasted_time_per_day;
    $time_base_cost_month = $time_base_cost_day*$working_days;
  
   $productivity_costs_day = $billable_rate*$wasted_time_per_day;
    $productivity_costs_month = $productivity_costs_day*$working_days;
  
   $fuel_base_cost_day = $wasted_time_per_day*$fuel_price_per_liter*$fuel_wasted_per_hr;
   $fuel_base_cost_month = $fuel_base_cost_day*$working_days;
    $monthly_cost_per_unit = 35;
    $lost_per_vehicle_per_month = ($time_base_cost_month+$productivity_costs_month+$fuel_base_cost_month) - $monthly_cost_per_unit ;
  
   $monthly_savings_per_truck = $lost_per_vehicle_per_month;//Monthly Savings = (Monthly Time Based Costs + Monthly Productivity Costs + Monthly Fuel Based Costs) – Monthly Costs per Unit.
  
   $monthly_savings_per_fleet = $monthly_savings_per_truck*$no_of_trucks;
  
  
     $monthly_cost_per_fleet = $no_of_trucks*$monthly_cost_per_unit;
  
  
  
      $link = mysql_connect('##', '##', '##');
      mysql_select_db('##', $link);
  
  
   if( (!empty($choose_industry)) &amp;&amp; (!empty($company_name)) &amp;&amp; (!empty($hourly_rate)) &amp;&amp; (!empty($billable_rate)) &amp;&amp; (!empty($working_days)) &amp;&amp; (!empty($wasted_time_per_day)) &amp;&amp; (!empty($no_of_trucks)) &amp;&amp; (!empty($fuel_price_per_liter)) &amp;&amp; (!empty($fuel_wasted_per_hr)) &amp;&amp; (!empty($time_base_cost_day)) &amp;&amp; (!empty($time_base_cost_month)) &amp;&amp; (!empty($productivity_costs_day)) &amp;&amp; (!empty($productivity_costs_month)) &amp;&amp; (!empty($fuel_base_cost_day)) &amp;&amp; (!empty($fuel_base_cost_month)) &amp;&amp; (!empty($monthly_savings_per_truck)) &amp;&amp; (!empty($monthly_savings_per_fleet)) ){
  
   $result = mysql_query("INSERT into wp_calculate (id, choose_industry, company_name, hourly_rate, billable_rate, working_days, wasted_time_per_day, no_of_trucks, fuel_price_per_liter, fuel_wasted_per_hr, time_base_cost_day, time_base_cost_month, productivity_costs_day, productivity_costs_month, fuel_base_cost_day, fuel_base_cost_month, monthly_savings_per_truck, monthly_savings_per_fleet, monthly_cost_per_unit, monthly_cost_per_fleet, Date ) values ('', '$choose_industry','$company_name', '$hourly_rate', '$billable_rate', '$working_days', '$wasted_time_per_day', '$no_of_trucks', '$fuel_price_per_liter', '$fuel_wasted_per_hr', '$time_base_cost_day', '$time_base_cost_month', '$productivity_costs_day', '$productivity_costs_month', '$fuel_base_cost_day', '$fuel_base_cost_month', '$monthly_savings_per_truck', '$monthly_savings_per_fleet', '$monthly_cost_per_unit', '$monthly_cost_per_fleet', now() )");
   $last_id = mysql_insert_id();
  
   $sql = "UPDATE wp_calculate SET pdf_link='/main/downloadpdf.php?user_id=$last_id' WHERE id=$last_id";
   $retval = mysql_query($sql);
  
  ?&gt;
  
  
   &lt;div class="offset-wrapper push-down3" id="cost_based"&gt;
  &lt;!--&lt;div class="span6"&gt;&lt;/div&gt;
  &lt;div class="span6"&gt;&lt;/div&gt;--&gt;
  &lt;div class="row cost_row" id="cost_row"&gt;
     &lt;div class="custom-calc-inner-2 wow bounceInLeft" data-wow-duration="3s" data-wow-delay="1s"&gt;
          &lt;h4&gt;Time Based Costs&lt;/h4&gt;
          &lt;p&gt;Cost of wasted time (per driver)&lt;/p&gt;
      &lt;div class="result"&gt;        
          &lt;div class="pos-left"&gt;
          &lt;p class="value"&gt;DAY&lt;/p&gt;&lt;p class="lbl"&gt;$&lt;?php echo $time_base_cost_day; ?&gt;&lt;/p&gt;
          &lt;/div&gt;
          &lt;div class="pos-right"&gt;
          &lt;p class="lbl"&gt;$&lt;?php echo $time_base_cost_month; ?&gt;&lt;/p&gt;&lt;p class="value"&gt;MONTH&lt;/p&gt;
          &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="clear"&gt;&lt;/div&gt;
      &lt;/div&gt;
  </code></pre>