Answer the question
In order to leave comments, you need to log in
Java. How to parse and translate JSON into XML without scientific (exponential) notation of numbers?
There is the following task/problem. From the server I receive the answer in the form of JSON'a. Using Java, you need to translate this JSON into a string containing valid XML.
Initially used org.Json . It can both parse json from a string and translate parsed JSON into XML. Everything would be fine, but this library converts large / long numbers into an exponential (scientific) form, which I do NOT need in the final XML string. How to display numbers in a normal form using org.json, I did not understand. Next I tried Gson . It parses JSON without any exponents (it even has a corresponding setting), but I didn’t figure out how to convert gson to XML. =_=
Surely someone has already solved a similar problem? Please tell me the recipe for converting JSON to XML in Java, keeping the numbers in their normal form.
And yes, Json comes from the server without exp.forms of the record.
PS It would be ideal if the specified answer-solution normalized those numbers that come from the server in scientific form (well, what if they come?) , But this is already additional and optional :)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question