I am using jquery mobile framework with Java (json with spring) for my mobile application.server sends response as 1.2345678901234568E16 for one of the value but jquery in user interface, its not displaying the value as it is. It is doing type conversion/auto rounding off while displaying in UI.
I am using Double datatype in server side. Also i tried use .attr() attribute to get the original value. But the problem is, am iterating over the dynamic values. could you please help me out to solve this issue? Please let me know if you need further information.
function onSuccess(data) {
var i = 0; $.each(data, function(index, pelem) {
$.each(pelem, function(key, element) {
i = i + 1; var name = ""; var amount = 0; var tolerance = 0; var fixed = false; if (element.person != null) {
name = element.person.description; amount = element.amount; tolerance = element.tolerance* 100; if (element.amount == null) fixed = false; else fixed = true;
}
In this, amount is actually 1.2345678901234568E16 but jquery converts this to 12345678901234568 automatically. When we print the output of the server response, its prints as expected. (in server side, am using rest web services so that i can see the response in the browser)
onSuccess() will receive the data from response and display it in UI. It is displaying now but with rounded value not actual value. It supposed to display 1.2345678901234568E16 but its diaplying 12345678901234568
service response and ui display:
Can anybody help us to come out?