示例#1
0
def test_long_num():
    assert scinot.format(341283875012.238, 4) == "3.413 × 10¹¹"
示例#2
0
def test_0_sigfigs():
    # disply scinot with standard number and 0 as digits count

    with pytest.raises(ValueError):
        scinot.format(1234567890, 0)
示例#3
0
def test_neg_num():
    assert scinot.format(-8328389, 1) == "-8 × 10⁶"
示例#4
0
def test_lower_sigfigs():
    assert scinot.format(.0000098326543, 3) == "9.83 × 10⁻⁶"
示例#5
0
def test_tiny_num():
    assert scinot.format(.0000098326543, 6) == "9.83265 × 10⁻⁶"
示例#6
0
def test_short_num():
    assert scinot.format(15, 4) == "1.5 × 10"