Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/mathlib.py
diff options
context:
space:
mode:
authorReinier Heeres <reinier@heeres.eu>2007-12-19 16:32:38 (GMT)
committer Reinier Heeres <reinier@heeres.eu>2007-12-19 16:32:38 (GMT)
commit550b858305b6a3c7c6bb39f4f14c38e0afd64870 (patch)
tree086a990712de3ee9348842cf5a0927b9122a137f /mathlib.py
parent79ce2543e3baad8f4f6c51bb0be05fcefebcb3f6 (diff)
Parsing with different fraction separator, #5319
Diffstat (limited to 'mathlib.py')
-rw-r--r--mathlib.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/mathlib.py b/mathlib.py
index 5dc10d7..4c3fe3b 100644
--- a/mathlib.py
+++ b/mathlib.py
@@ -38,6 +38,8 @@ class MathLib:
self.constants = {}
self.set_angle_type(self.ANGLE_DEG)
+ self.setup_i18n()
+
#Constants should maybe become variables in eqnparser.py
self.set_constant('true', True)
self.set_constant('false', False)
@@ -53,8 +55,6 @@ class MathLib:
self.set_constant('c_n', self.parse_number('0')) #neutron properties
self.set_constant('m_n', self.parse_number('1.6749272928e-27'))
- self.setup_i18n()
-
def setup_i18n(self):
loc = locale.localeconv()
@@ -105,6 +105,8 @@ class MathLib:
return None
def parse_number(self, s):
+ s = s.replace(self.fraction_sep, '.')
+
try:
d = Decimal(s)
if self.is_int(d):