Ejemplo n.º 1
0
    def test_get_separators(self):
        expected = {"thousand_sep": ",", "decimal_sep": "."}
        nt.assert_equal(expected, ft.get_separators("2,123.45"))

        expected = {"thousand_sep": ".", "decimal_sep": ","}
        nt.assert_equal(expected, ft.get_separators("2.123,45"))

        with nt.assert_raises(ValueError):
            ft.get_separators("spam")
Ejemplo n.º 2
0
    def test_get_separators(self):
        expected = {'thousand_sep': ',', 'decimal_sep': '.'}
        nt.assert_equal(expected, ft.get_separators('2,123.45'))

        expected = {'thousand_sep': '.', 'decimal_sep': ','}
        nt.assert_equal(expected, ft.get_separators('2.123,45'))

        with nt.assert_raises(ValueError):
            ft.get_separators('spam')
Ejemplo n.º 3
0
    def test_get_separators(self):
        expected = {'thousand_sep': ',', 'decimal_sep': '.'}
        nt.assert_equal(expected, ft.get_separators('2,123.45'))

        expected = {'thousand_sep': '.', 'decimal_sep': ','}
        nt.assert_equal(expected, ft.get_separators('2.123,45'))

        with nt.assert_raises(TypeError):
            ft.get_separators('spam')
Ejemplo n.º 4
0
def convert_amount(content):
    """Convert number to a decimal amount"""
    return to_decimal(content, **get_separators(content))
Ejemplo n.º 5
0
def convert_amount(content):
    return to_decimal(content, **get_separators(content))