By default, the Result box of the Evaluate dialog uses a format that matches the data type of the evaluate expression. Integer values, for example, are displayed in decimal form. To change the displaying format, add a comma (,) followed by a format specifier after the expression in the Expression edit box of the Evaluate dialog.
Suppose, you have a script variable named i
and you want to evaluate its value and display the result in the hexadecimal format. In this case:
- Type
i,h
in the Expression edit box. - Press Enter.
Script variables are specified by their names. If i
is a variable defined in a keyword test, you should type KeywordTests.KeywordTest_Name.Variables.i
.
The format specifiers are --
Specifier | Types affected | Description |
---|---|---|
,h | Integers | Hexadecimal. Displays integer values in the hexadecimal form (with the 0x prefix in JavaScript, JScript, Python, C#Script and C++Script, &H in VBScript, and $ in DelphiScript). |
,fn | Floating point | Floating point. Displays n significant digits where n can be from 2 to 18. For instance, to display the first four digits of a floating-point value, type ,f4. If n is not specified, the default is 11. |