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

Better documentations about deprecated parameters #393

Open
manuelep opened this issue Mar 20, 2020 · 4 comments
Open

Better documentations about deprecated parameters #393

manuelep opened this issue Mar 20, 2020 · 4 comments

Comments

@manuelep
Copy link

Hi!
Could you please provide in new release documentation what's the alternative of previous supported and now deprecated features like passing double_precision parameter?

Thanks a lot

Manuele
@hugovk
Copy link
Member

hugovk commented Mar 20, 2020

Hi! The double_precision option was removed in eb7d894. Here's the commit message:

To fix issues with floating-point precision we've made use of Google's
double-conversion lib to handle conversions of doubles to and from strings.

In addition to fixing our precision problems this will improve double
encoding by 4-5x. Decoding is however slightly slower according to the
benchmarks - but accurate at least.

This change removes the double_precision encoding option and the
precise_float decoding option.

This is linked to from the release notes at https://github.com/ultrajson/ultrajson/releases/tag/2.0.0. In this case, there is no alternative, remove the option from your calls.

@manuelep
Copy link
Author

Thanks @hugovk for your quick replay!
What do you mean saing that there's no alternative? Is actually no more possile to control the floating point numbers precision while they are encoded or the way I can obtain the same result I got with that option is complete different? In that last case is there some example on how can I get it?

Thanks a lot
Cheers

Manuele

@hugovk
Copy link
Member

hugovk commented Mar 20, 2020

Please check the commit for more info, but yeah, looks like Google's library is used for all conversions of doubles to and from strings.

@manuelep
Copy link
Author

You have to excuse me, I'm not a C programmer and on the first attempt I saw toow mutch C code :-P

So now, if I well understood, before encoding my object I have to convert my self all nested float values to a decimal object of the desidered precision... right?

Thanks again.
Cheers

Manuele 

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

No branches or pull requests

2 participants