diff options
| author | Keith Packard <keithp@keithp.com> | 2014-06-02 22:06:22 -0700 | 
|---|---|---|
| committer | Keith Packard <keithp@keithp.com> | 2014-06-02 22:06:22 -0700 | 
| commit | 206fbb99d28961ce159e3affdd5c96f5e379a603 (patch) | |
| tree | c187b5692d8de09a407450f2d88424dfcd5ee753 /altosui/AltosConfigPyroUI.java | |
| parent | d20c608ce833fb8949dce527f92887775d216823 (diff) | |
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 <keithp@keithp.com>
Diffstat (limited to 'altosui/AltosConfigPyroUI.java')
| -rw-r--r-- | altosui/AltosConfigPyroUI.java | 10 | 
1 files 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) | 
