def eight_decimal_places(amount, format="<STR_LIT:str>"):
if type(amount) == str:<EOL><INDENT>return amount<EOL><DEDENT>if format == '<STR_LIT:str>':<EOL><INDENT>return "<STR_LIT>" % amount<EOL><DEDENT>if format == '<STR_LIT:float>':<EOL><INDENT>return float("<STR_LIT>" % amount)<EOL><DEDENT>
>>> 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