I have coordinates saved in firebase, such as this:
lat: 19535037.77154548
lng: -4578925.543895042
But when I try to load them into a number it changes it to something like 1.953503777154548E7
static double homeLat;
Ref.addValueEventListener(new ValueEventListener() {
@Override
public void onDataChange(DataSnapshot snapshot) {
homeLat = (double) snapshot.child("lat").getValue();
}
@Override
public void onCancelled(FirebaseError firebaseError) {
}
});
I have tried changing it from double to int and various others, but it errors out and tells me it needs to be double. Yet double changes the decimal placing and adds the E7 to the end.
I'm not going to lie, i'm pretty new to java and having to assign types of numbers. But I have been reading for awhile now with not much luck as to why I am getting this problem.