REPORTER 22.1
Controlling the Precision/Decimal Places of a Variable
Controlling the precision/decimal places of a variable
The precision of a variable can be set in the window when inserting it. See the section above on variable format . Alternatively the precision can be set when typing in the variable.
For example, for a variable called ACCELERATION , if a local format of a two decimal place floating point number is specified, the variable ACCELERATION will appear as % ACCELERATION(2f) %. When generated, this will appear as the formatted value. A complete list of the formats is available in the table below.
| Format | Example | Input string | Output string |
| Fixed | %NAME(2f)% |
1234.5678
12.345678 |
1234.56
12.35 |
| Exponential / scientific | %NAME(2e)% |
1234.5678
12.345678 |
1.23e+03
1.23e+01 |
| General. uses exponential format or fixed format (whichever is the most concise) | %NAME(2g)% |
1234.5678
12.345678 |
1.23e+03
12 |
| Integer | %NAME(i)% |
1234.5678
12.345678 |
1235
12 |
| Lower case | %NAME(s)% | reporter | |
| Upper case | %NAME(S)% | REPORTER |