/** Human friendly number suffix - From: http://stackoverflow.com/questions/2692323/code-golf-friendly-number-abbreviator */
functionhumanFriendlyNumber(n,d){
varp,d2,i,s;
p=Math.pow;
d2=p(10,d);
i=7;
while(i){
s=p(10,i--*3);
if(s<=n){
n=Math.round(n*d2/s)/d2+"KMGTPE"[i];
}
}
returnn;
}
/** Format numbers with commas - From: http://stackoverflow.com/questions/2901102/how-to-print-a-number-with-commas-as-thousands-separators-in-javascript */