Browse Source

sum: refactor

Fabian Peter Hammerle 7 years ago
parent
commit
b90accd2d4
1 changed files with 3 additions and 3 deletions
  1. 3 3
      finoex/__init__.py

+ 3 - 3
finoex/__init__.py

@@ -95,10 +95,10 @@ class Sum(ioex.calcex.Figure):
     currency_regex = r"[^\d\s-]+"
 
     sum_regex = [
-        r'^\$?(?P<value>{}) (?P<curr>{})$'.format(
+        r'^\$?(?P<value>{}) (?P<currency>{})$'.format(
             value_regex, currency_regex,
         ),
-        r'^(?P<curr>{}) ?(?P<value>{})$'.format(
+        r'^(?P<currency>{}) ?(?P<value>{})$'.format(
             currency_regex, value_regex,
         ),
     ]
@@ -116,7 +116,7 @@ class Sum(ioex.calcex.Figure):
         attr = match.groupdict()
         return Sum(
             value=locale.atof(attr['value']),
-            currency=attr['curr'],
+            currency=attr['currency'],
         )