function parseSpeedToBits(speedString) {
	var formatted = speedString.replace(/\s+/g, "").toLowerCase();

	if (formatted === 'unlimited' || formatted === 'unspecified') {
		return '';
	}

	var match = formatted.match(/^(\d+(\.\d+)?)(gbps|mbps|bps)$/);

	if (!match) {
		throw new Error("Problem with processing in JS, no such speed format: " + speedString);
	}

	var value = parseFloat(match[1]),
		unit = match[3];

	switch (unit) {
		case 'gbps':
			return value * 1e9;
		case 'mbps':
			return value * 1e6;
		case 'bps':
			return value;
		default:
			throw new Error("Problem with processing in JS, unsupported unit: " + unit);
	}
}

var speedsInBits = parseSpeedToBits(value);

return speedsInBits;