altos: Change ao_mpu6000_gyro arg to float
[fw/altos] / altoslib / AltosHeight.java
index d7192e0b6512d5dccf8c9e9150d70a8a810f19a7..1d2e4dbce499562d9db2a4d73df41efed1454d70 100644 (file)
@@ -15,7 +15,7 @@
  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
  */
 
-package org.altusmetrum.altoslib;
+package org.altusmetrum.altoslib_2;
 
 public class AltosHeight extends AltosUnits {
 
@@ -25,6 +25,13 @@ public class AltosHeight extends AltosUnits {
                return v;
        }
 
+       public double parse(String s) throws NumberFormatException {
+               double  v = Double.parseDouble(s);
+               if (AltosConvert.imperial_units)
+                       v = AltosConvert.feet_to_meters(v);
+               return v;
+       }
+
        public String show_units() {
                if (AltosConvert.imperial_units)
                        return "ft";
@@ -37,7 +44,7 @@ public class AltosHeight extends AltosUnits {
                return "meters";
        }
 
-       int show_fraction(int width) {
+       public int show_fraction(int width) {
                return width / 9;
        }
 }
\ No newline at end of file