We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[30.0, 27.2, -2.0].mongoize returns [30, 27.2, -2.0] and [30.0, 27.2, -2.0].mongoize.map{|e| e.class} returns [Fixnum, Float, Fixnum]
[30.0, 27.2, -2.0].mongoize
[30, 27.2, -2.0]
[30.0, 27.2, -2.0].mongoize.map{|e| e.class}
[Fixnum, Float, Fixnum]
The text was updated successfully, but these errors were encountered:
I found this while storing geo coordinates using a Mongoid model. Some of the coordinates are now Integers while others are Floats.
Apparently it's done deliberately (see here and here), but it makes no sense to convert floats to integers, just because the fractional part is zero.
Sorry, something went wrong.
I think this was added to fix another issue, see 701a8f7
So when you have "2." it would convert to 2... but 2.0 should be a Float IMO.
"2."
2.0
@MartinNowak want try to fix this and send a PR? thanks
Sure will do.
No branches or pull requests
[30.0, 27.2, -2.0].mongoize
returns[30, 27.2, -2.0]
and
[30.0, 27.2, -2.0].mongoize.map{|e| e.class}
returns[Fixnum, Float, Fixnum]
The text was updated successfully, but these errors were encountered: