function toThousands(num) {
var num=num.toString().split(".");
var znum = (num[0] || 0).toString(), result = '';
while (znum.length > 3) {
result = ',' + znum.slice(-3) + result;
znum = znum.slice(0, znum.length - 3);
}
if (znum) { result = znum + result; }
let fnum = num[1]
if(fnum){
if(fnum.length==1){
fnum=fnum+"0";
}
}else{
fnum='00';
}
return result+'.'+fnum
}
toThousands(123456.1)