From a2cf07c010e5c9c12eb3f763a21c1f1067df8554 Mon Sep 17 00:00:00 2001 From: Daniel Brown <ddb@star.sr.bham.ac.uk> Date: Wed, 17 Sep 2014 12:25:14 +0100 Subject: [PATCH] Changing param str method so that it writes the full floating point precision rather than just 12sf --- pykat/param.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pykat/param.py b/pykat/param.py index b5c9566..31fe7c3 100644 --- a/pykat/param.py +++ b/pykat/param.py @@ -120,6 +120,8 @@ class Param(putable, putter): def __str__(self): if self._owner().removed: raise pkex.BasePyKatException("{0} has been removed from the simulation".format(self._owner().name)) + elif type(self.value) == float: + return repr(self.value) else: return str(self.value) @@ -127,7 +129,7 @@ class Param(putable, putter): if self._owner().removed: raise pkex.BasePyKatException("{0} has been removed from the simulation".format(self._owner().name)) else: - return self.value + return float(self.value) def getFinesseText(self): if self._owner().removed: -- GitLab