import re


def number_of_significant_figures(num):
    """ Returns the number of significant figures a value has. """
    if isinstance(num, int) or num.is_integer():
        num = int(num)
        sig_figs = len(str(num).strip('0'))
    else:
        num_parts = re.split(r'[\.eE]', str(num))
        sig_figs = len(num_parts[1])
    return sig_figs