-
Notifications
You must be signed in to change notification settings - Fork 8
setPrecision
Purpose: Sets the maximum precision for decimal calculations.
Syntax: setPrecision {value}
value: The new precision limit for decimals used during script interpretation.
Notes: This command is used to enable decimal calculations within TWX script.
By default, the decimal precision within a script is set to 0, this is to maintain backwards compatibility with older scripts that do not take decimal mathematics into consideration.
TWX Proxy supports decimal precision of up to 20 significant digits from calculations.
Once the precision has been set, all math performed will take into account the new precision and try to round all resulting values towards it. There is no limit to the number of times the precision can be changed within a script - in some cases it can be useful to adjust it for specific scenarios or subroutines.
Example:
# This will set precision to a max of 10 decimal places
setPrecision 10
.