javascript - Struts 2 - Double with scientific notation issue -


i'm having problem dealing struts 2 , javascript. javascript code:

geocoder.geocode({'address': address}, function(results, status) {                 if (status == google.maps.geocoderstatus.ok) {                     var latitud = results[0].geometry.location.lat();                     var longitud = results[0].geometry.location.lng();                     document.getelementbyid("goplans_evo_latitud").value = latitud;                     document.getelementbyid("goplans_evo_longitud").value = longitud;                     document.getelementbyid("goplans").submit();                 }              }); 

when i'm trying print these 2 values (latitude & longitude) on script side returns (p.ex.):

41.3970035 2.189719200000013

and if print them on action method (after struts 2 set values on double objects) returns this:

4.13970035e8 2.189719200000013e15

i noticed scientific notation. try format them these values wrong formatted.

this action method (very simple):

public string goplans() {     system.out.println(evo.getlatitud() + " " + evo.getlongitud());     return success; } 

can me know how set correctly these values using struts 2?

thank you.

edit: found problem! need declare longitude , latitude bean variables double (primitive) not double (class).

i found problem! need declare longitude , latitude bean variables double (primitive) not double (class).


Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -