def test_format_number_si(): np.testing.assert_equal(misc._format_number_si(-12345, 2), '-1.2e4') np.testing.assert_equal(misc._format_number_si(123456, 2), '1.2e5') np.testing.assert_equal(misc._format_number_si(-123456, 2), '-1.2e5') np.testing.assert_equal(misc._format_number_si(-123456.393, 2), '-1.2e5') np.testing.assert_equal(misc._format_number_si(1234567, 2), '1.2e6') np.testing.assert_equal(misc._format_number_si(0.12, 2), '1.2e-1') np.testing.assert_equal(misc._format_number_si(3.32, 2), '3.3e0')
def test_format_number_inf(self): np.testing.assert_equal(misc._format_number_si(float('inf'), 2), 'inf') np.testing.assert_equal(misc._format_number_si(float('-inf'), 2), '-inf')