Solution 1 :

okay so i created a new jsfiddle an focused on my if statments only

i managed to anser my own questions with this code

      if (latt > 0) {
      alert('posotive')
      } else {
      alert('negative')
      }

i then altered it to my needs within my script

its a shame people had to accuse me of no reasrch i just needed a chat and some help but tremdous thanks to the first commenter evolutionxbox

so first for the code so i dont upset down voters

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;
  
   if (latt > 0) {latt = latt +  " ° N";} else {latt = latt + " ° S"

}

   if (longt > 0) {
  longt = longt +  " ° E";
  } else {
  longt = longt + " ° W"

 }

var stringerr = latt + " / " + longt
    $div1_.textContent = stringerr;
  });
} else $div1_.textContent = 'Network response was not ok.';
})
.catch(error =>
$div1_.textContent = 'Fetch error: ' + error
);

here is the working jsfiddle for anyone needing visual help like i often do

fiddle

Problem :

I have the following code which grabs the latt and longitude for london

And returns me the results 51.49742 / -0.14159

Here’s my JSFiddle
jsfiddle example

here was the original

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.

By