08-11-2015 04:11 AM
Hi,
I have a value in seconds that I display in relative time format, I want to read this exact value and input it into a string, what I receive in the string however is the original number in seconds.
Is there a way around this or of formatting the output of the variable.
Michael
Solved! Go to Solution.
08-11-2015 04:18 AM - edited 08-11-2015 04:21 AM
Hi Michael,
when you read the value of your control/indicator you get the value! (THINK DATAFLOW!)
I want to read this exact value and input it into a string
No, you don't want to read the "exact value"! You want to read the displayed text formatted by your indicator settings!
To get the currently displayed text you can use a property node of your indicator and read the "Text.Text" property…
08-11-2015 04:25 AM - edited 08-11-2015 04:28 AM
The formatting of the number is handled by the numeric indicator you use to display it. The number (representing seconds) contains no formatting information itself - it is just a number.
To format this into a string use the format date time string or format into string functions.
Alternatively, to capture the actual string that is displayed in your numeric indicator, create a property node and select the Numeric Text->Text property.
EDIT: Damn - I hate these Forum race conditions!
@ GerdW
08-11-2015 04:31 AM
And this is why this forum is so great, the perfect answer in less than half an hour.
Thanks guys!