@moto_zhang wrote:
Format string is 5%d,I have already tried it.
moto-zhang
Please don't post incorrect information, 5%d is not even a valid format string for this problem! (It would turn e.g. an input of 17 into a string of 517). 😞
@Beagles wrote:
The problem is that I need a string of 5 chars at all times, that is an output of the ´format into string´ that is int the range of 00000...65535. Is there any settings under the properties tab for the numeric control that I am missing, or is there a better way to get this working. I really want to use the Format Into String function for this. I app. any hints !
Beagles
Just to clarify, the properties of the numeric control only determine how the number in the control is displayed, it has no influence on the internal representation or later formatting operations. This is purely cosmetic. Still if you want your control also to display 5 digits with leading zeroes, right-click on it and select format&precision. Now choose:
-zero digits of precision
-minimum field width=5
-pad with zeroes on the left.
As mentioned before, use a %05d as a format when using "format into string". (The "%" identifies it as a formatting operation, the "0" causes leading zeroes to be displayed, the "5" forces a minimum widht of 5 characters and the "d" formats it as decimal integer.)
Attached is a small demo that illustrates this (LabVIEW 7.0). It also shows a plain numeric indicator set to display in the same way.