Code example for NumberFormat

Methods: setGroupingUsed, setMaximumFractionDigits, setMaximumIntegerDigits

0
    // GPX readers expect to see fractional numbers with US-style punctuation. 
    // That is, they want periods for decimal points, rather than commas. 
    ELEVATION_FORMAT.setMaximumFractionDigits(1);
    ELEVATION_FORMAT.setGroupingUsed(false);
 
    COORDINATE_FORMAT.setMaximumFractionDigits(6);
    COORDINATE_FORMAT.setMaximumIntegerDigits(3);
    COORDINATE_FORMAT.setGroupingUsed(false);
  } 
 
  private final Context context;
  private Track track;
  private PrintWriter printWriter;
 
  public GpxTrackWriter(Context context) {
    this.context = context;
  } 
 
  @Override 
  public String getExtension() {
    return TrackFileFormat.GPX.getExtension();