Command Reference

Format Number

This action will format a floating-point number to a specified number of decimal places.

Action ID: 78
Action Category: Strings

Settings

Store result in variable:

The variable that will store the formatted number.

Number to format:

The number that will be formatted.

Number of decimal places:

The number of decimal places that the number should be rounded or truncated to.

Method:

The method that should be used to format the number. Round will round the number up or down to the specified number of decimal places. A digit of five or greater gets rounded up while less than five gets rounded down. Truncate will simply cut the number off at a certain number of decimal places without rounding.

Return Values

None.

Example

The following command will round PI to four decimal places (3.1416):

Store result in variable: %RoundedPI%
Number to format: 3.1415926
Number of decimal places: 4
Method: Round

 

See Also: Alphabetical List of Actions, Categorical List of Actions, On Error tab