
function replace8a8(str) {
	if (!str || str == '') str = "0";
	str = str.toUpperCase();
	var splitstr = "____";
	var ar = str.replace(/,/,'.').replace(/ /, '').replace(
		/(([0-9]*\.)?[0-9]+([eE][-+]?[0-9]+)?)(.*)/,
	 "$1"+splitstr+"$4").split(splitstr);
	var num = Number(ar[0]).valueOf();
	var ml = ar[1].replace(/\s*([(KB)(MB)(GB)B])\s*/, "$1");

	if (ml == "KB")
		num *= 1024;
	else if(ml == "MB")
		num *= 1024 * 1024;
	else if (ml == "GB")
		num *= 1024 * 1024 * 1024;
	else if (ml == "TB")
		num *= 1024 * 1024 * 1024 * 1024;
	// B and no prefix

	return num;
}

SortableTable.prototype.addSortType( "NumberK", replace8a8 );