import Vue from 'vue'
// import { formatDate } from '@/utils/dateAndTimeUtils.js';


Vue.filter("numberFormat",(value) => {
	if(!value) value = 0;
	var param = {};
	var k = 10000,
		sizes = ['', '万', '亿', '万亿'],
		i;
		if(value < k){
			param.value =value
			param.unit=''
		}else{
			i = Math.floor(Math.log(value) / Math.log(k));
			param.value = ((value / Math.pow(k, i))).toFixed(2);
			param.unit = sizes[i];
		}
		let str = param.value + param.unit;
	return str;
})


// Vue.filter("formatDate",(data)=>{
// 	const nDate=new Date(data);
// 	const year = nDate.getFullYear().toString().padStart(2,0);
// 	const month = nDate.getMonth().toString().padStart(2,0);
// 	const day = nDate.getDay().toString().padStart(2,0);
// 	const h = nDate.getHours().toString().padStart(2,0);
// 	const mm = nDate.getMinutes().toString().padStart(2,0);
// 	const s = nDate.getSeconds().toString().padStart(2,0);
// 	return year +'-'+ month +'-'+ day + " " + h + ":" + mm + ":"+ s
// })