Check out example codes for "mile to nautical mile". It will help you in understanding the concepts better.

Code Example 1

//divide the length bu 1.151

//OR
int length = 1;
int nmi = length / 1.151

Learn ReactJs, React Native from akashmittal.com