Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decimal number support, or workaround #65

Open
tuscland opened this issue Oct 7, 2014 · 4 comments
Open

Decimal number support, or workaround #65

tuscland opened this issue Oct 7, 2014 · 4 comments
Assignees
Milestone

Comments

@tuscland
Copy link

tuscland commented Oct 7, 2014

Hello,

JSX is a nice and concise library, thank you!

I would like to use the numeric format for decimal numbers, unfortunately the number representation only works with erlang floating point values.

One solution I see would be to give a binary-string representation of the decimal number, boxed in a tuplewith a special key telling JSX to format it as a number, perhaps by ways of escaping the value in a special tuple, something like:

[
    {<<"my_decimal_number">>, {'_json_number', <<"23.01">>}}
]

Of course, this also poses the problem of decoding a decimal number with JSX. Again, we could choose to box the string representation of a number so the choice to actually decode it to a float is left to the user. This process could be selected by an option...

Any ideas?

Best,
Cam

@talentdeficit
Copy link
Owner

i'm still working on a more user friendly way to handle custom encoding/decoding. i'll hopefully have something for you soon

@tuscland
Copy link
Author

tuscland commented Sep 4, 2015

Hi,
May I ask you if you have made progress on this project?
Thanks!

@talentdeficit
Copy link
Owner

i have, but i've been busy with other projects. i'll try to get a new release out in the next week or two

@talentdeficit talentdeficit added this to the 2.8 milestone Sep 22, 2015
@paulo-ferraz-oliveira
Copy link
Contributor

@talentdeficit: did this eventually make its way to the code base? Is this still a valid concern?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants