-
Notifications
You must be signed in to change notification settings - Fork 152
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
Encoding of double variables that happen to be integral #1592
Comments
Glaze, like Are you wanting to dump floating point numbers with a decimal place so that you can determine if they are integers or floating point numbers? I'm curious what is your motivation? We could add an option that allows you to add a |
Hi @stephenberry , thanks for the reply. The motivation is that the client side of my application is doing schema validation on the json string received. And this is causing error on the client-side checker because it assumes that the Yes it would be useful, or rather critical in my case, to have the formatting option for floating point numbers! If you agree that this is useful and decide to implement this, would you mind sharing when can we expect this feature roughy? Much apreciation! |
I can understand your motivation and why it may be a requirement. But, I am leery of this approach, because you are relying on specific format that is outside the scope of JSON, so your program will then fail with perfectly valid JSON. If you only needed this support in a few places then using the I don't think I'm going to do this immediately, because I'm currently trying to finalize a new approach for handling compile time options, and this will need to be another compile time option that is a little more complex because it requires a flexible string input. It will probably be a few months before this is implemented. |
Hi,
I'm trying to assess if I can make my application migrate from using Rapid Json to using Glaze. And I'm noticing a behavioral difference:
Let's say I have a double variable of value 10.0
If I encode var with Rapid Json, I'll get
{"var": 10.0}
Whereas if I encode the following with Glaze:
I'll get
{"var": 10}
Is it possible to have a compile-time option where I can get the
.0
with Glaze?The text was updated successfully, but these errors were encountered: