From 9c08af0ecb4b4e59bb36de9a60b0a7d906b743ca Mon Sep 17 00:00:00 2001 From: Skalii Date: Tue, 2 Feb 2021 14:55:41 +0200 Subject: [PATCH] fix speed unit setting for "min/km" to show seconds instead of fractional minutes --- 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 11267b0286..6a52fe9804 100644 --- a/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java +++ b/OsmAnd/src/net/osmand/plus/OsmAndFormatter.java @@ -344,8 +344,8 @@ public class OsmAndFormatter { if (minperkm >= 10) { return ((int) Math.round(minperkm)) + " " + mc.toShortString(ctx); } else { - int mph10 = (int) Math.round(minperkm * 10f); - return (mph10 / 10f) + " " + mc.toShortString(ctx); + int seconds = Math.round(minperkm * 60); + return Algorithms.formatDuration(seconds, false) + " " + mc.toShortString(ctx); } } else if (mc == SpeedConstants.MINUTES_PER_MILE) { if (metersperseconds < 0.111111111) {