import math


def floor(quantity, units):
    """Compute the floor of a quantity with units.

    :param quantity: the quantity to take the ceiling of
    :param units: the units to convert to before taking the ceiling, and of the result
    :returns: the ceiling of quantity, measured in units
    """
    number = quantity.to(units).magnitude
    return math.floor(number) * units