def round_significant(x, n=1): """Round x to n significant digits.""" return 0 if x==0 else round(x, -int(floor(log10(abs(x)))) + (n-1))