summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Christopher Anderson <jchris@apache.org>2010-06-24 18:07:00 +0000
committerJohn Christopher Anderson <jchris@apache.org>2010-06-24 18:07:00 +0000
commit1448ec8c3d9ea004061100f1042840e14ba16769 (patch)
treef1180bf18c7cb3c6e02992785ec11e1ed3c5ddca
parent88caaddccbe40a148ffd83aab6fdd78b68442ecf (diff)
patch mochijson2 to allow output of big integers not in float form (it stores them just fine)
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@957656 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--src/mochiweb/mochijson2.erl5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/mochiweb/mochijson2.erl b/src/mochiweb/mochijson2.erl
index 66f68bf0..111c37bd 100644
--- a/src/mochiweb/mochijson2.erl
+++ b/src/mochiweb/mochijson2.erl
@@ -98,11 +98,8 @@ json_encode(false, _State) ->
<<"false">>;
json_encode(null, _State) ->
<<"null">>;
-json_encode(I, _State) when is_integer(I) andalso I >= -2147483648 andalso I =< 2147483647 ->
- %% Anything outside of 32-bit integers should be encoded as a float
- integer_to_list(I);
json_encode(I, _State) when is_integer(I) ->
- mochinum:digits(float(I));
+ integer_to_list(I);
json_encode(F, _State) when is_float(F) ->
mochinum:digits(F);
json_encode(S, State) when is_binary(S); is_atom(S) ->