From 51732515a8c53a9323b614a087ba362ef136090e Mon Sep 17 00:00:00 2001 From: sonora Date: Tue, 18 Jun 2013 16:47:22 +0200 Subject: [PATCH] fix small rounding error --- OsmAnd/src/net/osmand/plus/OsmAndFormatter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java index e7f3658af0..48b0294d45 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java @@ -62,9 +62,9 @@ public class OsmAndFormatter { if (meters >= 100 * mainUnitInMeters) { return (int) (meters / mainUnitInMeters + 0.5) + " " + ctx.getString(mainUnitStr); //$NON-NLS-1$ } else if (meters > 9.99f * mainUnitInMeters) { - return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters + 0.5) / mainUnitInMeters); //$NON-NLS-1$ + return MessageFormat.format("{0,number,#.#} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ } else if (meters > 0.999f * mainUnitInMeters) { - return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters + 0.5) / mainUnitInMeters); //$NON-NLS-1$ + return MessageFormat.format("{0,number,#.##} " + ctx.getString(mainUnitStr), ((float) meters) / mainUnitInMeters); //$NON-NLS-1$ } else { if (mc == MetricsConstants.KILOMETERS_AND_METERS) { return ((int) meters + 0.5) + " " + ctx.getString(R.string.m); //$NON-NLS-1$