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