Permalink
Browse files

Use repr() to prevent data loss for numbers.

>>> a = 20000000.00000003
>>> unicode(a)
u'20000000.0'
>>> unicode(repr(a))
u'20000000.00000003'
  • Loading branch information...
opello committed Dec 2, 2013
1 parent 98a4f5d commit 46fa0c11b4a3a2e6d9b79d9817eeee523b305bdb
Showing with 1 addition and 1 deletion.
  1. +1 −1 python-jsonrpc/jsonrpc/json.py
@@ -115,7 +115,7 @@ def dumpParts (obj):
yield part
yield u']'
elif objType in [IntType, LongType, FloatType]:
yield unicode(obj)
yield unicode(repr(obj))
else:
raise JSONEncodeException(obj)

0 comments on commit 46fa0c1

Please sign in to comment.