export function abbreviateCount(value, unit) {
	let n = value
	if (unit === 'thousand') {
		if (n > 9999) n = (n / 10000).toFixed(1) + 'w'
		else if (n > 999) n = (n / 1000).toFixed(1) + 'k'
	}
	if (unit === 'hundred' && n > 99) n = '99+'
	return n
}

export function bytesToMegabytes(limit, withUnit = true) {
	return (limit / (1024 * 1024)).toFixed(1) + (withUnit ? 'MB' : '')
}
