def _getformat(val):
    """
    Get the output format for a floating point number.

    The general format is used with 16 places of accuracy, except for when
    the floating point value is an integer, in which case a decimal point
    followed by a single zero is used.

    Parameters
    ----------
    val : float or int
        the number which needs formatted.

    Returns
    -------
    string
        the format string.
    """
    if int(val) == val:
        return '%.1f'
    else:
        return '%.16g'
