From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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
(5,515 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
(5,511 Views)

You mean in the ExpressionBrowser?

Can you post a screenshot?

Thx

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

NumericFormat.png

Config.PNG

Jason H
Automated Test Software R&D
Message 4 of 5
(5,504 Views)
Solution
Accepted by topic author 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
(5,501 Views)