Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/calculate.py
diff options
context:
space:
mode:
Diffstat (limited to 'calculate.py')
-rw-r--r--calculate.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/calculate.py b/calculate.py
index 0e1512f..049cc34 100644
--- a/calculate.py
+++ b/calculate.py
@@ -808,10 +808,11 @@ class Calculate(activity.Activity):
def format_insert_ans(self):
ans = self.parser.get_var('Ans')
if isinstance(ans, Rational):
- ansstr = str(ans)
+ return str(ans)
+ elif ans is not None:
+ return self.ml.format_number(ans)
else:
- ansstr = self.ml.format_number(ans)
- return ansstr
+ return ''
def main():
win = gtk.Window(gtk.WINDOW_TOPLEVEL)