I’d really like to have the label, the value, and the units for a tag all in one label component. However, this leads to either the label or unit (depending on leading/trailing alignment) shifting as optional digits pop in and out.
Has anybody come up with a nice way to replace leading/trailing 0’s in a formatted number with whitespace (blanks)?
For instance, a flow meter that flows up to 1000 gal. Would show “__50 gal” or “_120 gal” or “1000 gal” instead of “50 gal”, “120 gal”, and “1000 gal”, respectively.
Thanks for this. This is something that’s really not documented in the user manual. I don’t see any reference to the 10.2 portion of the %10.2f format string in the documentation for the stringFormat() function or in the Data Type Formatting Reference, or the different characters used for each data type.
When I use this I get an IllegalFormatConversionException: f != java.lang.Integer error.
I’m using %f and my number that’s being formatted is a float.
By adding toFloat() around my tags, I get rid of the error, but odd that just using a float tag directly causes the error.
However, this does not seem to have the desired effect. Usign %3.2f I would expect to get _ _ _._ _ but that is not the case. The extra spaces are still being discareded.