Use full 3 digit resolution in distance display - very useful for off-road navigation.

This commit is contained in:
rogere66 2011-08-25 09:02:06 +03:00
parent c7213a8fd4
commit 241e8d9039

View file

@ -63,9 +63,9 @@ public class OsmAndFormatter {
if (meters >= 100 * mainUnitInMeters) { if (meters >= 100 * mainUnitInMeters) {
return (int) (meters / mainUnitInMeters) + " " + ctx.getString(mainUnitStr); //$NON-NLS-1$ return (int) (meters / mainUnitInMeters) + " " + ctx.getString(mainUnitStr); //$NON-NLS-1$
} else if (meters > 1.5f * mainUnitInMeters) { } else if (meters > 9.99f * mainUnitInMeters) {
return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$
} else if (meters > 0.9f * mainUnitInMeters) { } else if (meters > 0.999f * mainUnitInMeters) {
return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$
} else { } else {
if (mc == MetricsConstants.KILOMETERS_AND_METERS) { if (mc == MetricsConstants.KILOMETERS_AND_METERS) {