02-13-2015 08:56 PM
Hi All,
If a control already has a unit, and we pass it to a format into string function, its not displaying the same exact unit. For example, below the control has unit of "g", while the format string has unit of "kg".
Attached VI in 2010 format.
Thanks,
Karthik
Solved! Go to Solution.
02-13-2015 09:49 PM
Read the help for the format specifier.
1. Use %{g}f to make it look like grams.
2. Put a convert Unit function containing g on the wire going to the format into string function.
02-13-2015 09:51 PM
02-13-2015 10:13 PM
Ravens,
I did read the LabVIEW help, and knew of explicitly mentioning the unit in format specifier. I was just wondering if it is possible to take the unit specifed in the control automatically, without explicitly mentioning it in the format specifier.
Mike,
Thanks, that answers my question.
02-13-2015 10:41 PM
It wasn't clear from your message what you were ultimately trying to do.
You can "automatically" take the unit specified in the control along with the unit specification for a format into string like I called out. Use the UnitLabel.Text to build a format string code to convert the string.
See attached.
02-13-2015 10:47 PM
Ravens,
Sorry if I wasn't clear. The solution you suggested seems to be a good work around for what I wanted to do.Thanks!