function formatNumber(money){
money = money+"";
var resultMoney = money+"";
var isNaNMoney = Number(money);
if(isNaN(isNaNMoney)){
return money;
};
if(money.slice(0,1)!="-"){
money = Number(money)+"";
}else{
money = Number(money.slice(1,money.length))+"";
}
var str = money.split('.');
money = str[0];
if(money.slice(0,1) === '0'){
if(money.length > 1){
money = money.substring(1,money.length);
}
}
var result = '';
while(money.length >= 4){
result = ','+money.slice(-3)+result;
money = money.slice(0,money.length-3);
}
if(money){
result = money+result;
}
if(str.length >= 1){
for(var x = 0; x < str.length; x++){
if(resultMoney.indexOf(".")!= -1){
if(x==0){
result = result+".";
}else{
result = result+str[x];
}
}
}
}
if(resultMoney.slice(0,1)=="-"&&result!="0"){
result = "-"+result;
}
return result;
}
06-10
463
12-05
543
02-24
547
06-17
328