def test_sigFigs_bad_n(): misc.sigFigs(1.234, 0)
def test_sigFigs_baseline_lt1(): x2 = 0.12345 nt.assert_equal(misc.sigFigs(x2, 3), '0.123') nt.assert_equal(misc.sigFigs(x2, 4), '0.1235')
def test_sigFigs_pvals_noop(): p = 0.001 nt.assert_equal(misc.sigFigs(p, 1, pval=True), '0.001')
def test_sigFigs_pvals_op_tex(): p = 0.0005 nt.assert_equal(misc.sigFigs(p, 3, tex=True, pval=True), '$<0.001$')
def test_sigFigs_exponents_notex_gt1(): x1 = 123456789.123456789 nt.assert_equal(misc.sigFigs(x1, 3, tex=False), '1.23e+08')
def test_sigFigs_exponents_tex_gt1(): x1 = 123456789.123456789 nt.assert_equal(misc.sigFigs(x1, 3, tex=True), r'$1.23 \times 10 ^ {8}$')
def test_sigFigs_exponents_tex_lt1(): x2 = 0.000000123 nt.assert_equal(misc.sigFigs(x2, 3, tex=True), r'$1.23 \times 10 ^ {-7}$')
def test_sigFigs_exponents_notex_lt1(): x2 = 0.000000123 nt.assert_equal(misc.sigFigs(x2, 3, tex=False), '1.23e-07')
def test_sigFigs_trailing_zeros_lt1(): x2 = 0.12345 nt.assert_equal(misc.sigFigs(x2, 8), '0.12345000')
def test_sigFigs_trailing_zeros_gt1(): x1 = 1234.56 nt.assert_equal(misc.sigFigs(x1, 8), '1,234.5600')
def test_sigFigs_pvals_op(): p = 0.0005 nt.assert_equal(misc.sigFigs(p, 3, pval=True), '<0.001')
def test_sigFigs_exception(): misc.sigFigs(199, -1)
def test_sigFigs_baseline_gt1(): x1 = 1234.56 nt.assert_equal(misc.sigFigs(x1, 3), '1,230') nt.assert_equal(misc.sigFigs(x1, 4), '1,235')