def _truncate(f, n):
s = "<STR_LIT:{}>".format(f)<EOL>if "<STR_LIT:e>" in s or "<STR_LIT:E>" in s:<EOL><INDENT>return "<STR_LIT>".format(f, n)<EOL><DEDENT>i, p, d = s.partition("<STR_LIT:.>")<EOL>return "<STR_LIT:.>".join([i, (d+"<STR_LIT:0>"*n)[:n]])<EOL>
Truncates/pads a float `f` to `n` decimal places without rounding

    From https://stackoverflow.com/a/783927/1307974 (CC-BY-SA)