From e5fcfff75c5eb760e7ded471521a4a097ec80971 Mon Sep 17 00:00:00 2001
From: Miguel Garcia <miguel.garcia@gmail.com>
Date: Mon, 19 Mar 2012 04:14:57 -0300
Subject: [PATCH] Ticket #2332 Rational format problem
---
mathlib.py | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/mathlib.py b/mathlib.py
index d0fabc8..746df48 100644
a
|
b
|
class MathLib: |
221 | 221 | elif type(n) is types.LongType: |
222 | 222 | n = self.d(n) |
223 | 223 | elif isinstance(n, Rational): |
224 | | n = self.d(float(n)) |
| 224 | n = self.d(Decimal(n.n) / Decimal(n.d)) |
225 | 225 | elif not isinstance(n, Decimal): |
226 | 226 | return _('Error: unsupported type') |
227 | 227 | |