def as_unit(unit, precision=2, location='suffix'):
    """Convert value to unit.

    Parameters:
    -----------
    :param v: numerical value
    :param unit: string of unit
    :param precision: int
        decimal places to round to
    :param location:
        'prefix' or 'suffix' representing where the currency symbol falls
        relative to the value
    """
    if not isinstance(precision, Integral):
        raise TypeError("Precision must be an integer.")

    if location == 'prefix':
        formatter = partial(_format_numer, prefix=unit)
    elif location == 'suffix':
        formatter = partial(_format_numer, suffix=unit)
    else:
        raise ValueError("location must be either 'prefix' or 'suffix'.")

    return _surpress_formatting_errors(
        formatter("0.{}f".format(precision))
    )
Convert value to unit.

    Parameters:
    -----------
    :param v: numerical value
    :param unit: string of unit
    :param precision: int
        decimal places to round to
    :param location:
        'prefix' or 'suffix' representing where the currency symbol falls
        relative to the value