I am using UE 13.10a+1. I'm trying to change coordinate values digital minutes to digital degrees.
From the following:
The first line should read:
Longitude = 87 + (1.5319959 / 60), latitude = 32 + (24.3091365 / 60)
I must keep the output values to 7 decimal places and rounding the 7th place.
Here is the code I'm using. The calculation is taking place in the second loop (which is totally wrong). This is my first attempt at JavaScript and I've tried several different ways, but I just can't seem to get calculations to work.
Thanks, Paul
From the following:
Code: Select all
-87 1.5319959 32 24.3091365 624.8 599999.5 0
-87 1.4278910 32 24.3534171 624.8 600600.4 0
-87 1.3237846 32 24.3976961 624.8 600599.8 0
-87 1.2196764 32 24.4419736 624.8 600599.8 0
-87 0.8032268 32 24.6190693 624.8 600.0 0
Code: Select all
-87.0255333,32.4051523,624.8
I must keep the output values to 7 decimal places and rounding the 7th place.
Here is the code I'm using. The calculation is taking place in the second loop (which is totally wrong). This is my first attempt at JavaScript and I've tried several different ways, but I just can't seem to get calculations to work.
Code: Select all
UltraEdit.insertMode();
if (typeof(UltraEdit.columnModeOff) == "function") UltraEdit.columnModeOff();
else if (typeof(UltraEdit.activeDocument.columnModeOff) == "function") UltraEdit.activeDocument.columnModeOff();
UltraEdit.activeDocument.hexOff();
UltraEdit.ueReOn();
UltraEdit.activeDocument.findReplace.regExp = true;
UltraEdit.activeDocument.findReplace.replaceAll = false;
UltraEdit.activeDocument.bottom();
if (UltraEdit.activeDocument.isColNumGt(1)) UltraEdit.activeDocument.insertLine();
UltraEdit.activeDocument.top();
var runn = "%^(RUN [0-9]+^) +^(-[0-9]+ [0-9]+.[0-9]+ [0-9]+ [0-9]+.[0-9]+^) +^(-[0-9]+ [0-9]+.[0-9]+ [0-9]+ [0-9]+.[0-9]+^) ^([0-9]+^) [0-9]*$";
while ( (UltraEdit.activeDocument.findReplace.find(runn)) && ! UltraEdit.activeDocument.isEof() ) {
UltraEdit.activeDocument.findReplace.replace(runn,"^1" + " Total Points = " + "^4");
}
UltraEdit.activeDocument.top();
var coors = "% ^(-[0-9]+^) ^([0-9]+.[0-9]+^) ^([0-9]+^) ^([0-9]+.[0-9]+^) ^([0-9]*^) [0-9]*$";
while ( (UltraEdit.activeDocument.findReplace.find(coors)) && ! UltraEdit.activeDocument.isEof() ) {
UltraEdit.activeDocument.findReplace.replace(coors, ("^1" + ("^2" / 60)) + "," + "("^3" + ("^4" /60))" + "," + "^5");
}
UltraEdit.activeDocument.top();