def nearly_equal(a, b, sig_fig=5):
    return a == b or int(a * 10 ** sig_fig) == int(b * 10 ** sig_fig)
Function to determine if two numbers are nearly equal when rounded to n significant decimal digits