def in_units(qty, units):
    """
    Convert quantity to specified `units` and return numerical value.

    If `qty` is `None`, then return `None`, regardless of `units`.

    .. note::
        If `qty` is not `None`, then the following two expressions are
        equivalent:

            1. ``chemtk.units.in_units(qty, units)``
            2. ``qty.in_units(units)``

    Parameters
    ----------
    qty : :class:`Quantity` or NoneType
        Specify the quantity to convert
    units : str or :class:`Quantity`
        Describe the units to convert `qty` to

    Returns
    -------
    number : int, float, or NoneType
        The numerical value of the converted quantity, if `qty` is not None;
        otherwise `None`
    """
    if qty is None:
        return None
    return qty.in_units(units)