Example #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")
Example #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')
Example #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')
Example #4
0
def convert_amount(content):
    """Convert number to a decimal amount"""
    return to_decimal(content, **get_separators(content))
Example #5
0
def convert_amount(content):
    return to_decimal(content, **get_separators(content))