aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorSamuel Tardieu <sam@rfc1149.net>2011-11-07 11:21:13 +0100
committerSamuel Tardieu <sam@rfc1149.net>2011-11-07 12:53:29 +0100
commitc67baaf158d1102335b02defcfa445c3dda5fca0 (patch)
tree5e7f5d8b486d254d0f0a9f85f52453900000bc49 /main
parent9fcea63557cf82328c53ae9871b077d59b11c7f7 (diff)
downloadcgeo-c67baaf158d1102335b02defcfa445c3dda5fca0.zip
cgeo-c67baaf158d1102335b02defcfa445c3dda5fca0.tar.gz
cgeo-c67baaf158d1102335b02defcfa445c3dda5fca0.tar.bz2
Use existing method to render altitude
Diffstat (limited to 'main')
-rw-r--r--main/src/cgeo/geocaching/cgeo.java7
-rw-r--r--main/src/cgeo/geocaching/cgeonavigate.java7
2 files changed, 2 insertions, 12 deletions
diff --git a/main/src/cgeo/geocaching/cgeo.java b/main/src/cgeo/geocaching/cgeo.java
index 313d4b7..616aa9f 100644
--- a/main/src/cgeo/geocaching/cgeo.java
+++ b/main/src/cgeo/geocaching/cgeo.java
@@ -574,12 +574,7 @@ public class cgeo extends AbstractActivity {
}
} else {
if (geo.altitudeNow != null) {
- String humanAlt;
- if (Settings.isUseMetricUnits()) {
- humanAlt = String.format("%.0f", geo.altitudeNow) + " m";
- } else {
- humanAlt = String.format("%.0f", (geo.altitudeNow * 3.2808399)) + " ft";
- }
+ final String humanAlt = cgBase.getHumanDistance(geo.altitudeNow.floatValue() / 1000);
navLocation.setText(cgBase.formatCoords(geo.coordsNow, true) + " | " + humanAlt);
} else {
navLocation.setText(cgBase.formatCoords(geo.coordsNow, true));
diff --git a/main/src/cgeo/geocaching/cgeonavigate.java b/main/src/cgeo/geocaching/cgeonavigate.java
index 284698d..47c2b0a 100644
--- a/main/src/cgeo/geocaching/cgeonavigate.java
+++ b/main/src/cgeo/geocaching/cgeonavigate.java
@@ -381,12 +381,7 @@ public class cgeonavigate extends AbstractActivity {
}
if (geo.altitudeNow != null) {
- String humanAlt;
- if (Settings.isUseMetricUnits()) {
- humanAlt = String.format("%.0f", geo.altitudeNow) + " m";
- } else {
- humanAlt = String.format("%.0f", (geo.altitudeNow * 3.2808399)) + " ft";
- }
+ final String humanAlt = cgBase.getHumanDistance(geo.altitudeNow.floatValue() / 1000);
navLocation.setText(cgBase.formatCoords(geo.coordsNow, true) + " | " + humanAlt);
} else {
navLocation.setText(cgBase.formatCoords(geo.coordsNow, true));