Changeset 14203 in josm for trunk/src/org
- Timestamp:
- 2018-08-29T21:15:20+02:00 (6 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/coor/conversion
- Files:
-
- 3 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 -
trunk/src/org/openstreetmap/josm/data/coor/conversion/DMSCoordinateFormat.java
r12846 r14203 15 15 public class DMSCoordinateFormat extends AbstractCoordinateFormat { 16 16 17 private static final DecimalFormat DMS_MINUTE_FORMATTER = new 18 private static final DecimalFormat DMS_SECOND_FORMATTER = new 17 private static final DecimalFormat DMS_MINUTE_FORMATTER = newUnlocalizedDecimalFormat("00"); 18 private static final DecimalFormat DMS_SECOND_FORMATTER = newUnlocalizedDecimalFormat( 19 19 Config.getPref() == null ? "00.0" : Config.getPref().get("latlon.dms.decimal-format", "00.0")); 20 20 private static final String DMS60 = DMS_SECOND_FORMATTER.format(60.0); -
trunk/src/org/openstreetmap/josm/data/coor/conversion/NauticalCoordinateFormat.java
r12846 r14203 14 14 */ 15 15 public class NauticalCoordinateFormat extends AbstractCoordinateFormat { 16 private static final DecimalFormat DM_MINUTE_FORMATTER = new 16 private static final DecimalFormat DM_MINUTE_FORMATTER = newUnlocalizedDecimalFormat( 17 17 Config.getPref() == null ? "00.000" : Config.getPref().get("latlon.dm.decimal-format", "00.000")); 18 18 private static final String DM60 = DM_MINUTE_FORMATTER.format(60.0);
Note:
See TracChangeset
for help on using the changeset viewer.