def parseUnits(value, units):
	"""
	Parses a value with a unit and returns it in the base unit.

	:param value: str The value to parse
	:param units: list of tuples of unit names and multipliers
	:return: int
	"""
	n = len(value)
	for i, c in enumerate(value):
		if c.isalpha():
			n = i
			break

	numberStr = value[:n]
	number = float(numberStr)

	unitStr = value[n:]
	for unit, multiplier in units:
		if unitStr == unit:
			return int(multiplier * number)

	raise ValueError('Unknown unit "%s"' % unitStr)