Format numbers before writing to json
Issue #544
new
or we risk ending up with default notation.
For instance now we have this in the default config :
"priceIncrement":3.0E-4,
I suggest the following :
Utils.formatNumber(<yournumber>,Settings.DEFAULT_PRECISION)
Comments (10)
-
-
reporter - changed milestone to 0.2.1 - Price-feed streaming service implementation
-
reporter I also tried a couple of solutions without success. Scientific notation is handled correctly when read from file to UI.
The only case where this could create issues is when the user types a small number in the UI and then wants to edit the config manually.
Its a very unlikely situation, we can postpone it
-
reporter - changed milestone to 0.3.1 - Price-feed streaming service implementation
-
- marked as major
-
can be achieved like this. but currently I can't reproduce, since Json String output works correctly also. I assume this happens only when we post via the UI.
GsonBuilder gson = new GsonBuilder().setPrettyPrinting(); gson.setLongSerializationPolicy( LongSerializationPolicy.STRING );
-
reporter - changed milestone to 9.9 Undefined future release
-
reporter - removed responsible
-
-
assigned issue to
-
assigned issue to
-
- removed responsible
- Log in to comment
This needs a change in Gson serializer. complicated... I tried solutions suggested here, but its not working
http://stackoverflow.com/questions/11119094/switch-off-scientific-notation-in-gson-double-serialization