fetch('https://geocode.xyz/london?json=1')
.then(response => {
if (response.ok) {
response.json().then(data => {
fbjson = data;
var latt = fbjson.alt.loc.latt;
var longt =fbjson.alt.loc.longt;
var stringerr = latt + " / " + longt
$div1_.textContent = stringerr;
});
} else $div1_.textContent = 'Network response was not ok.';
})
.catch(error =>
$div1_.textContent = 'Fetch error: ' + error
);
now where I am stuck is I am trying to determine n/s for latt and e/w for longt and display the result simaler to Google like this
googles results = 51.5074° N, 0.1278° W
I would like
51.5074° N / 0.1278° W
How can I determine and add
° W or others accordingly to the long and latt
Comments
Comment posted by evolutionxbox
I would assume a negative lat is E, and a negative long is S?
Comment posted by Ashley Taylor
also i dont have to state i have reaserched i have already stated i have been reaserching and creating my code i would get this far without any reasearch
Comment posted by Ashley Taylor
could u help and point me in the direction to using the if statments <0
Comment posted by Ashley Taylor
see andrea this is where u dont think properly a person may reaserch and find info close to helping but then not understand the actual statments before him and then came here looking for help and examples
Comment posted by zero298
Your code needs to be included in your question, not externally on a fiddle. Your lack of included code is why you are getting close and down votes. Put your code here. Explain what you tried.