def eight_decimal_places(amount, format="str"):
    """
    >>> eight_decimal_places(3.12345678912345)
    "3.12345679"
    >>> eight_decimal_places("3.12345678912345")
    "3.12345679"
    >>> eight_decimal_places(3.12345678912345, format='float')
    3.12345679
    >>> eight_decimal_places("3.12345678912345", format='float')
    3.12345679
    """
    if type(amount) == str:
        return amount
    if format == 'str':
        return "%.8f" % amount
    if format == 'float':
        return float("%.8f" % amount)