PropertyObject.GetFormattedValue
- Updated2024-10-09
- 2 minute(s) read
PropertyObject.GetFormattedValue
Syntax
PropertyObject.GetFormattedValue( lookupString, options, formatString = "", useValueFormatIfDefined = False, separator = "")
Return Value
Formatted string value of the property
Purpose
Returns a formatted string that describes the value of the object.
Remarks
Use this string to display the value of an object. For string, number, and Boolean Array objects, the method returns a string composed of the concatenated values of the array elements. For Container objects, this method returns the string "...". For empty Reference objects, the method returns the string Nothing .
Place a $ character after the % character in the format string to remove trailing zeros after the decimal point.
Use a "%s" style format specifier to format any value as a string with a specified width and alignment. For example, calling this method on the string value "Right justified" with a format string of "%20s" returns:
" Right justified"
Use a format code of %b to format a number in binary.
Parameters
lookupString As String
[In] Pass an empty string to denote the PropertyObject to which the method applies, or pass the name of a subproperty within the PropertyObject. You can also pass lookup strings to this parameter.
options As Long
[In] Specifies how the method determines which character is the localized decimal point, which it uses to localize the display value. Pass one of the following options: PropOption_DecimalPoint_UseComma , PropOption_DecimalPoint_UsePeriod , PropOption_DecimalPoint_UsePreference , or PropOption_DecimalPoint_UseSystemSetting . Use the bitwise-OR operator to specify multiple options.
formatString As String
[In] Specifies a C (printf) style format string to control the conversion. When you pass an empty string, this method uses the following default TestStand format strings based on the numeric representation of the numeric property objects:
- %.13g for double-precision, 64-bit floating-point values
- %d for signed 64-bit integer values
- %u for unsigned 64-bit integer values
This parameter has a default value of "" .
useValueFormatIfDefined As Boolean
[In] Specifies whether the function uses the inherent format of the first argument, if the argument value has a non-default numeric display format. If you pass True and the value argument has a non-default format, the function uses the value format instead of the format you pass to parameter three.
This parameter has a default value of False .
separator As String
[In] Specifies a string that separates each element in the concatenated string of array elements the function returns.
This parameter has a default value of "" .
See Also
DecimalPointLocalizationOptions
PropertyObject.GetDisplayNames
Thread Safety of the PropertyObject API and TestStand Variables