Check out example codes for "how to convert string to double in android studio". It will help you in understanding the concepts better.

Code Example 1

Double lat;
String lat_str = "17.456174";
try {
lat = Double.parseDouble(lat_str);
}catch (NumberFormatException e) {
//lat_string does not contain valid double value
}

Learn ReactJs, React Native from akashmittal.com