talentdeficit / jsx

an erlang application for consuming, producing and manipulating json. inspired by yajl
MIT License
695 stars 218 forks source link

Support encoding and decoding decimal #130

Closed ypcat closed 5 years ago

ypcat commented 5 years ago
1> jsx:encode(#{foo=>{0,314,-2}}).
<<"{\"foo\":3.14}">>
2> jsx:decode(jsx:encode(#{foo=>{0,314,-2}})).
[{<<"foo">>,3.14}]
3> jsx:decode(jsx:encode(#{foo=>{0,314,-2}}),[decimal]).
[{<<"foo">>,{0,314,-2}}]
ypcat commented 5 years ago

Sorry wrong PR target