Reputation: 19798
I have coordinates like this:
<googlemapsX>32.733611</googlemapsX>
<googlemapsY>-117.189722</googlemapsY>
And i want to show them like this:
String document = "<lbs>
<location lat='LAT' lon='LON'/>
</lbs>";
But LAT and LON must be integers, how to convert them?
Upvotes: 0
Views: 288
Reputation: 133
lat, long can be values like 32.733611, -117.189772 (double values)
int latitude = (int) (lat * 1e6);
int longitude = (int) (long * 1e6);
Upvotes: 1
Reputation: 10974
To convert them into the lat/lon that BlackBerry uses in its document, you can just multiply them by 100000 to get the correct value.
int lat = 32.733611 * 100000;
int lon = -117.189772 * 100000;
And use those values as your LAT and LON
Upvotes: 4