diff --git a/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.kt b/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.kt index 90b584b0a4..b351a90efb 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandFormatter.kt @@ -243,7 +243,7 @@ object OsmandFormatter { SpeedConstants.NAUTICALMILES_PER_HOUR -> kmh * METERS_IN_KILOMETER / METERS_IN_ONE_NAUTICALMILE SpeedConstants.MINUTES_PER_KILOMETER -> { if (metersPerSeconds < 0.111111111) { - return "-" + mc.toShortString(ctx) + return "-" + if (useLocalizedString) mc.toShortString(ctx) else mc.getDefaultString() } METERS_IN_KILOMETER / (metersPerSeconds * 60) } diff --git a/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandLocationUtils.kt b/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandLocationUtils.kt index 8e418ac0e0..2f801fe17f 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandLocationUtils.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/utils/OsmandLocationUtils.kt @@ -332,6 +332,9 @@ object OsmandLocationUtils { fun parseSpeed(speedS: String): Double { try { + if (!speedS.contains(" ")) { + return 0.0 + } val speedSplit = speedS.split(" ") val speedVal = speedSplit.first().toDouble() val speedFormat = OsmandFormatter.SpeedConstants.values().firstOrNull { it.getDefaultString() == speedSplit.last() }