
export function doubleToThousands(amount) {
	if(!amount) {
		return
	}
	let numList = amount.toString().split('.')
	
	let num = (numList[0] || 0).toString(), result = '';
	while (num.length > 3) {
		result = ',' + num.slice(-3) + result;
		num = num.slice(0, num.length - 3);
	}
	
	if (num) { result = num + result; }
	
	if(numList[1]) {
		return result + '.' + numList[1]
	}
	if(amount.endsWith('.')) {
		return result + '.'
	}
	return result
}