public String toSixFigureString(){
  int hundredkmE=(int)Math.floor(easting / 100000);
  int hundredkmN=(int)Math.floor(northing / 100000);
  String firstLetter;
  if (hundredkmN < 5) {
    if (hundredkmE < 5) {
      firstLetter="S";
    }
 else {
      firstLetter="T";
    }
  }
 else   if (hundredkmN < 10) {
    if (hundredkmE < 5) {
      firstLetter="N";
    }
 else {
      firstLetter="O";
    }
  }
 else {
    firstLetter="H";
  }
  int index=65 + ((4 - (hundredkmN % 5)) * 5) + (hundredkmE % 5);
  if (index >= 73)   index++;
  String secondLetter=Character.toString((char)index);
  int e=(int)Math.floor((easting - (100000 * hundredkmE)) / 100);
  int n=(int)Math.floor((northing - (100000 * hundredkmN)) / 100);
  String es="" + e;
  if (e < 100)   es="0" + es;
  if (e < 10)   es="0" + es;
  String ns="" + n;
  if (n < 100)   ns="0" + ns;
  if (n < 10)   ns="0" + ns;
  return firstLetter + secondLetter + es+ ns;
}

public String toSixFigureString ( ) { int hundredkmE = ( int ) Math . floor ( easting / 100000 ) ; int hundredkmN = ( int ) Math . floor ( northing / 100000 ) ; String firstLetter ; if ( hundredkmN < 5 ) { if ( hundredkmE < 5 ) { firstLetter = "S" ; } else { firstLetter = "T" ; } } else if ( hundredkmN < 10 ) { if ( hundredkmE < 5 ) { firstLetter = "N" ; } else { firstLetter = "O" ; } } else { firstLetter = "H" ; } int index = 65 + ( ( 4 - ( hundredkmN % 5 ) ) * 5 ) + ( hundredkmE % 5 ) ; if ( index >= 73 ) index ++ ; String secondLetter = Character . toString ( ( char ) index ) ; int e = ( int ) Math . floor ( ( easting - ( 100000 * hundredkmE ) ) / 100 ) ; int n = ( int ) Math . floor ( ( northing - ( 100000 * hundredkmN ) ) / 100 ) ; String es = "" + e ; if ( e < 100 ) es = "0" + es ; if ( e < 10 ) es = "0" + es ; String ns = "" + n ; if ( n < 100 ) ns = "0" + ns ; if ( n < 10 ) ns = "0" + ns ; return firstLetter + secondLetter + es + ns ; }
return a string representation of this osgb grid reference using the six - figure notation in the form xy123456
