iskra / jsonx

JSONX is an Erlang library for efficient decode and encode JSON, written in C.
Other
91 stars 32 forks source link

Option to decode fractional numbers to decimal #15

Open ymv opened 10 years ago

ymv commented 10 years ago

New decode option number_format - when set to decimal, numbers with exponent or fraction are decoded to erlang-decimal compatible tuple. For original behaviour omit this option or set it to float

{1,12,5} = jsonx:decode(<<"-1.2e6">>, [{number_format, decimal}]).