From e7faece56a5284305b087ad87d1f1f408ed8e891 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9rome=20Perrin?= <jerome@nexedi.com>
Date: Thu, 15 Apr 2010 08:43:01 +0000
Subject: [PATCH] when indexing float, use repr rather than str to have better
 precision

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@34572 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5Type/patches/sqlvar.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/product/ERP5Type/patches/sqlvar.py b/product/ERP5Type/patches/sqlvar.py
index 13eef31a57..1b7e57ba0a 100644
--- a/product/ERP5Type/patches/sqlvar.py
+++ b/product/ERP5Type/patches/sqlvar.py
@@ -54,7 +54,9 @@ def SQLVar_render(self, md):
                 if v[-1:]=='L':
                     v=v[:-1]
                 atof(v)
-            else: v=str(float(v))
+            # ERP5 patch, we use repr that have better precision than str for
+            # floats
+            else: v=repr(float(v))
         except:
             if not v and args.has_key('optional') and args['optional']:
                 return 'null'
-- 
2.30.9