function formatNumber(number,pattern){
var str = number.toString();
var strInt;
var strFloat;
var formatInt;
var formatFloat;
if(/\./g.test(pattern)){
formatInt = pattern.split('.')[0];
formatFloat = pattern.split('.')[1];
}else{
formatInt = pattern;
formatFloat =null;
}
if(/\./g.test(str))