# HG changeset patch # User Yuya Nishihara # Date 1410960061 -32400 # Node ID a0829ec34dbd97fe7c11f894a790d4ff47d95bdf # Parent 17eeda31e52b4c4a6e84fd5f862b0d010be49f7f formatter: convert float value to json It will be used to encode ctx.date(). diff -r 17eeda31e52b -r a0829ec34dbd mercurial/formatter.py --- a/mercurial/formatter.py Wed Sep 17 21:30:22 2014 +0900 +++ b/mercurial/formatter.py Wed Sep 17 22:21:01 2014 +0900 @@ -91,8 +91,8 @@ def _jsonifyobj(v): if isinstance(v, tuple): return '[' + ', '.join(_jsonifyobj(e) for e in v) + ']' - elif isinstance(v, int): - return '%d' % v + elif isinstance(v, (int, float)): + return str(v) else: return '"%s"' % encoding.jsonescape(v)