ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

comparing two numbers

Hi,

I want to compare strings (format FLxxx where x is a number). I am getting the xxx number from some other part of my program. now the number can be a 2 digit or a 3 digit one. If it's a two digit number, I want to add a 0 before the number and then append it to FL. And if it's a 3 digit number I just want to return the same number. How can I do this operation? 

Thank you.

0 Kudos
Message 1 of 2
(3,183 Views)

Use the format into string function with FL%03d as the format specifier - this will take a number in, pad it to 3 characters with 0's and add the FL at the start.


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 2 of 2
(3,181 Views)