There is error in cursorPosition code. Whenever the world co-ordinate is in the exponential form (say 3.3100324202343583E7), the data displayed in the text field is not correct. It is because 3.3100324202343583E7 is being treated as 3.310032420234358 and not 33100324.20234358. My suggestion is that you just need to convert the double in exponential from to decimal form.
Problem is in function: