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 <keithp@keithp.com>
AltosUnits units = AltosPyro.pyro_to_units(flag);
if (units != null)
unit_value = units.value(new_value);
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)
+ else if (scale >= 10)
+ format = "%6.1f";
+ else
+ format = "%6.0f";
value.setText(String.format(format, unit_value));
}
if (combo != null)
value.setText(String.format(format, unit_value));
}
if (combo != null)