Hi Soumadri Roy, MarkLogic merely omitted non-significant decimals in the serialized form of the JSON, or maybe your browser is actually doing that. The JSON datatype is Number, which is a double by definition, regardless if the number has a fraction or not. See also for instance:
http://www.tutorialspoint.com/json/json_data_types.htm Is this giving you trouble somehow? Kind regards, Geert From: <[email protected]<mailto:[email protected]>> on behalf of "Roy Chowdhury, Soumadri" <[email protected]<mailto:[email protected]>> Reply-To: MarkLogic Developer Discussion <[email protected]<mailto:[email protected]>> Date: Tuesday, January 12, 2016 at 1:34 PM To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>> Subject: [MarkLogic Dev General] JSON transformation problem Hi, I am trying to transform the below mentioned XML data into JSON: <data> <price1>10.23</price1> <price2>10.00</price2> </data> When I am executing it against a database which does not have the respective schema associated I am getting the following output: {"data":{"price1":"10.23", "price2":"10.00"}} When I am executing it against a database with proper schema associated, it returns the following: {"data":{"price1":10.23, "price2":10}} Note that the second one treated the values as integer. This is not happening when the data is returned in XML format. Why the function is behaving differently in the above two cases and is there a way to retain two decimal places after dot(.) even when the schema is associated? Regards, Soumadri Roy "This e-mail and any attachments transmitted with it are for the sole use of the intended recipient(s) and may contain confidential , proprietary or privileged information. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of this e-mail or any action taken in reliance on this e-mail is strictly prohibited and may be unlawful."
_______________________________________________ General mailing list [email protected] Manage your subscription at: http://developer.marklogic.com/mailman/listinfo/general
