Esempio n. 1
0
def test_float2str_prefix_suffix_separator():
    assert str_tools.float2str(23.5, prefix='z', separator='p',
                               suffix='dex') == 'z23p5dex'
Esempio n. 2
0
def test_float2str_float():
    assert str_tools.float2str(23.5) == '23.5'
Esempio n. 3
0
def test_float2str_int():
    assert str_tools.float2str(23) == '23'
Esempio n. 4
0
def test_float2str_float_precision_zero():
    assert str_tools.float2str(23.5, precision=0) == '24'
Esempio n. 5
0
def test_float2str_float_precision_higher():
    assert str_tools.float2str(23.501345, precision=4) == '23.5013'
Esempio n. 6
0
def test_float2str_float_precision_lower():
    assert str_tools.float2str(23.5, precision=4) == '23.5000'
Esempio n. 7
0
def test_float2str_float_separator():
    assert str_tools.float2str(23.5, separator="p") == '23p5'