NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Convert Integer to string and show two digits

Solved!
Go to solution

Hello,

how can i convert an integer to a string?

StationGlobals.MyInteger is 1.

Using Str(StationGlobals.MyInteger) should convert it to "01" instead of only 1.

How can this be done?

 

Thx

0 Kudos
Message 1 of 5
(3,271 Views)

Hi OnlyOne,

 

You can achieve this functionality by right-clicking on StationGlobals.MyInteger, selecting Numeric Format, change the type to Integer, and increasing the Minimum Number of Digits to 2.

Jason H
Automated Test Software R&D
0 Kudos
Message 2 of 5
(3,267 Views)

You mean in the ExpressionBrowser?

Can you post a screenshot?

Thx

0 Kudos
Message 3 of 5
(3,265 Views)

NumericFormat.png

Config.PNG

Jason H
Automated Test Software R&D
Message 4 of 5
(3,260 Views)
Solution
Accepted by OnlyOne

Thanks for the screenshot.

I took the format string "%.2i" into my str() function and have now there also 2 digits.

 

Message 5 of 5
(3,257 Views)