Convert { @NonNull public static String pressure(double hPa) { if (Double.isNaN(hPa)) return ""; else return String.format(Locale.getDefault(), "%.2f hPa", hPa); }  static double kts2mps(double knots); @NonNull static String altitude(double m); @NonNull static String distance(double m); @NonNull static String distance(double m, int precision, boolean units); @NonNull static String distance2(double m, int precision); @NonNull static String distance3(double m); @NonNull static String speed(double mps); @NonNull static String speed(double mps, int precision, boolean units); @NonNull static String glide(double glideRatio, int precision, boolean units); @NonNull static String glide(double groundSpeed, double climb, int precision, boolean units); @NonNull static String glide2(double groundSpeed, double climb, int precision, boolean units); @NonNull static String pressure(double hPa); @NonNull static String angle(double degrees); @NonNull static String angle2(double degrees); @NonNull static String bearing2(double degrees); static boolean metric; static final double FT; static final double MPH; static final double KPH; static final float MPHf; static final float KPHf; static final String GLIDE_STATIONARY; static final String GLIDE_LEVEL; static final String GLIDE_VERTICAL; }
@Test public void convertPressure() { assertEquals("900.00 hPa", Convert.pressure(900.0)); assertEquals("", Convert.pressure(Double.NaN)); }