def _format_cell(cell, digits):
    """Return a formatted version of this cell of the data table.

    .. note::

        This is a private function called by :func:`print_normal`
        and :func:`print_latex`.

    :param cell:   cell to format
    :param digits: maximum number of digits to display
    :type cell:    `string`
    :type digits:  `integer`

    :return:       the formatted cell
    :rtype:        `string`

    """
    try:
        value = str(float(cell))
        if value[0] is '0':
            return value[1:digits + 2]
        elif value[0] is '-':
            if value[1] is '0':
                return ''.join(['-', value[2:digits + 3]])
            return value[:digits + 2]
        return value[:digits + 1]
    except ValueError:
        return cell
