Answer the question
In order to leave comments, you need to log in
How to leave all zeros in float in MongoDB?
Good afternoon! I'm using the Robo 3T (formerly Robomongo) Mac client, but when I add a value like "x": 1.000
, I get "x": 1.0
. Is there any way to disable this feature by removing zeros? Does this happen in MongoDB or does the client do it themselves? There must be at least 3 characters after the dot.
Answer the question
In order to leave comments, you need to log in
Understand that documents in Monge are stored in JSON, and in JSON your 1.0
number is stored, and it is not stored at all as it is shown. To store specific formatting , you need to store a string, not a number.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question