From 206fbb99d28961ce159e3affdd5c96f5e379a603 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 2 Jun 2014 22:06:22 -0700 Subject: [PATCH 1/1] 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 --- altosui/AltosConfigPyroUI.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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) -- 2.30.2