function encode(utm, accuracy) {
    var seasting = "" + utm.easting,
      snorthing = "" + utm.northing;

    return utm.zoneNumber + utm.zoneLetter + get100kID(utm.easting, utm.northing, utm.zoneNumber) + seasting.substr(seasting.length - 5, accuracy) + snorthing.substr(snorthing.length - 5, accuracy);
  }
Encodes a UTM location as MGRS string.

@private
@param {object} utm An object literal with easting, northing,
    zoneLetter, zoneNumber
@param {number} accuracy Accuracy in digits (1-5).
@return {string} MGRS string for the given UTM location.