Changeset 14203 in josm for trunk/src/org/openstreetmap/josm/data/coor/conversion/AbstractCoordinateFormat.java
- Timestamp:
- 2018-08-29T21:15:20+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/coor/conversion/AbstractCoordinateFormat.java
r12735 r14203 17 17 protected final String displayName; 18 18 19 /** 20 * The normal number format for server precision coordinates 21 */ 22 protected static final DecimalFormat cDdFormatter; 23 static { 24 // Don't use the localized decimal separator. This way we can present 25 // a comma separated list of coordinates. 26 cDdFormatter = (DecimalFormat) NumberFormat.getInstance(Locale.UK); 27 cDdFormatter.applyPattern("###0.0######"); 28 } 29 19 /** The normal number format for server precision coordinates */ 20 protected static final DecimalFormat cDdFormatter = newUnlocalizedDecimalFormat("###0.0######"); 30 21 /** Character denoting South, as string */ 31 22 protected static final String SOUTH = trc("compass", "S"); … … 40 31 this.id = id; 41 32 this.displayName = displayName; 33 } 34 35 /** 36 * Creates a new unlocalized {@link DecimalFormat}. 37 * By not using the localized decimal separator, we can present a comma separated list of coordinates. 38 * @param pattern decimal format pattern 39 * @return {@code DecimalFormat} using dot as decimal separator 40 * @see DecimalFormat#applyPattern 41 * @since 14203 42 */ 43 public static DecimalFormat newUnlocalizedDecimalFormat(String pattern) { 44 DecimalFormat format = (DecimalFormat) NumberFormat.getInstance(Locale.UK); 45 format.applyPattern(pattern); 46 return format; 42 47 } 43 48
Note:
See TracChangeset
for help on using the changeset viewer.