LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get 003 string instead of 3

Hello, my problem is that i am not able to format correctly a string. I'm using serial communication and before send a string i need the integer to have 3 digit always if it is a 1 digit i need it to have zeros to the left so it makes 001 or for example 27 comes 027. I use a control to get a number between 0 and 400, then i pass this number through a Number to Decimal String block and then I connect it to a format into string block. I can't find the correct format specifier to get the result i want. I add an image of my block diagram.
0 Kudos
Message 1 of 3
(3,271 Views)

Your wiring and function use is incorrect. You need to

  1. delete the number to decimal string function
  2. wire the blue number (wire) directly to the lower left terminal of the "format into string" function.
  3. Use a format specificer of "%03d" instead of "??????".

See if this helps.

Message Edited by altenbach on 10-21-2007 09:13 AM

Message 2 of 3
(3,268 Views)
Thank you very much, it really works.
0 Kudos
Message 3 of 3
(3,261 Views)