diff options
author | jomo <github@jomo.tv> | 2015-01-02 01:28:39 +0100 |
---|---|---|
committer | jomo <github@jomo.tv> | 2015-01-02 01:28:39 +0100 |
commit | 9110fc2eda3a0018f164510f8ef840969c4d6b75 (patch) | |
tree | ac29a34fae247baa5c6893d395e17bccde74e438 /calc.py | |
parent | 0842d921871a9bd33011d35fdd554189766bcf7c (diff) |
more calc improvements
Diffstat (limited to 'calc.py')
-rw-r--r-- | calc.py | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -14,7 +14,7 @@ def calc(text): expression = "" should_calc = False for char in text: - if char.isdigit() or char in [".", " "]: + if char.isdigit() or (should_calc and char in [".", " "]): expression += char elif char in math_operators: # calculation must include at least 1 operator |