From: Keith Packard Date: Tue, 3 Jun 2014 05:06:22 +0000 (-0700) Subject: altosui: Fix pyro channel value formatting X-Git-Tag: 1.3.2.2~25 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=206fbb99d28961ce159e3affdd5c96f5e379a603 altosui: Fix pyro channel value formatting Was using %6.1f for 1 and 2 fraction digit values as the conditional structure for figuring out which format to use was broken. Signed-off-by: Keith Packard --- diff --git a/altosui/AltosConfigPyroUI.java b/altosui/AltosConfigPyroUI.java index 9df2d87d..6cbac316 100644 --- a/altosui/AltosConfigPyroUI.java +++ b/altosui/AltosConfigPyroUI.java @@ -105,11 +105,13 @@ public class AltosConfigPyroUI AltosUnits units = AltosPyro.pyro_to_units(flag); if (units != null) unit_value = units.value(new_value); - String format = "%6.0f"; - if (scale >= 10) - format = "%6.1f"; - else if (scale >= 100) + String format; + if (scale >= 100) format = "%6.2f"; + else if (scale >= 10) + format = "%6.1f"; + else + format = "%6.0f"; value.setText(String.format(format, unit_value)); } if (combo != null)