NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to create two digits string of a loop counter i?

Solved!
Go to solution

Hello,

i have a loop that loops 20 times (1..20) with numeric variable i.

Now i want to use this i to create a switchingpath - but here i need string "01" instead of only "1".

So i cannot use only str(i)

How can i create the prefix 0 for i 1..9?

 

Thanks

0 Kudos
Message 1 of 3
(3,480 Views)
Solution
Accepted by topic author OnlyOne

Str(Locals.i, "%.2d")

 

 

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 3
(3,467 Views)

Hello,

 

The Str Function allow to use a C style format string. In your case, this may be something like that :

 

Str(Locals.i, "%02d")

 

Best regards,

0 Kudos
Message 3 of 3
(3,460 Views)