def formatter(type):
    """Format floating point numbers in scientific notation
    (integers use normal integer formatting)."""
    if type == int:
        return "%d"
    elif type == float:
        return "%.3e"