title: d3.format thousand separator on variables?
body: <p>Hello I'm yet again stuck on d3...</p>
  
  <p>I'd like to know how to use a thousand seperator on a variable all the examples I've managed to find seem to be on static data. </p>
  
  <p>This is what I've tried so far:</p>
  
  <pre><code>d3.csv("OrderValueToday.csv", function(obj) { 
  
  var text = 'Today = £';
  var totalSales = text + d3.format(",") + obj[0].Today;
  
  svgLabel = d3.select("#label").append("h2")
   .text (totalSales);
  
  });
  </code></pre>
  
  <p>However it just outputs a load a stuff on the webpage this is it:</p>
  
  <pre><code>Today = £function (n){var e=d;if(m&amp;&amp;n%1)return"";var u=0&gt;n||0===n&amp;&amp;0&gt;1/n?(n=-n,"-"):a;    if(0&gt;p){var c=Zo.formatPrefix(n,h);n=c.scale(n),e=c.symbol+d}else n*=p;n=g(n,h);var x=n.lastIndexOf("."),M=0&gt;x?n:n.substring(0,x),_=0&gt;x?"":t+n.substring(x+1);!s&amp;&amp;f&amp;&amp;(M=i(M));var b=v.length+M.length+_.length+(y?0:u.length),w=l&gt;b?new Array(b=l-b+1).join(r):"";return y&amp;&amp;(M=i(w+M)),u+=v,n=M+_,("&lt;"===o?u+n+w:"&gt;"===o?w+u+n:"^"===o?w.substring(0,b&gt;&gt;=1)+u+n+w.substring(b):u+(y?n:w+n))+e}20000
  </code></pre>
  
  <p>So all I want is to be able to make the <code>totalSales</code> value have thousand separators so like <code>20,000</code> everything else I've tried doesnt do anything. I've read this <a href="https://github.com/mbostock/d3/wiki/Formatting" rel="nofollow">https://github.com/mbostock/d3/wiki/Formatting</a> but didnt see what I could do for my scenario.</p>
  
  <p>Any help would be greatly appreciated. Cheers</p>