title: Number value format with comma and two decimal points
body: <p>I am using chart.js to display my sales the problem is I cannot convert the data into a number format with comma and two decimal places properly.</p>
  
  <p>When the data is a whole number the output is correct. However, when I display the average sales I am getting a output like</p>
  
  <blockquote>
    <p>Average Sales (no format) 1000.2017<br/>
    Average Sales (with format) 1,000.2,017<br/>
    Total Sales (no format) 1000<br/>
    Total Sales (with format) 1,000<br/></p>
  </blockquote>
  
  <p>How can format the out put correctly in javascript?</p>
  
  <pre><code>tooltips: {
    callbacks: {
       label: function(tooltipItem, data) {
           var value = data.datasets[0].data[tooltipItem.index];
           value = value.toString();
           value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                return value;
             }
         }
    },
     scales: {
       yAxes: [{
         ticks: {
           userCallback: function(value, index, values) {
             value = value.toString();
             value = value.replace(/\B(?=(\d{3})+(?!\d))/g, ",");
                return value;
           }
          }
      }]
  }
  </code></pre>