Behavior:
When working with values in a workflow (Dividing, Multiplying, etc...), the value returned contains more decimal places than desired.
For example, if we used the following arithmetic expression, 300 / 23, this would return a result value of 13.0434782608696
Solution:
To set a returned value of two decimal places, the Math.Round() method can be utilized in an arithmetic expression. When we use the following,
When working with values in a workflow (Dividing, Multiplying, etc...), the value returned contains more decimal places than desired.
For example, if we used the following arithmetic expression, 300 / 23, this would return a result value of 13.0434782608696
Solution:
To set a returned value of two decimal places, the Math.Round() method can be utilized in an arithmetic expression. When we use the following,
Math.Round(Value, DecimalPlaces)
Where Value is the number we're looking to trim down to the desired decimal places, and DecimalPlaces is the number of decimal places we want to stop at.
This will result in the value provided being trimmed down to only the designated amount of decimal places.
Where Value is the number we're looking to trim down to the desired decimal places, and DecimalPlaces is the number of decimal places we want to stop at.
This will result in the value provided being trimmed down to only the designated amount of decimal places.
Using the value from the previous example, Math.Round(13.0434782608696, 2), this will return 13.04.
Note: When rounding dollar amounts, please check any internal policies with the finance department.
Note: When rounding dollar amounts, please check any internal policies with the finance department.
KBA is applicable for both Cloud and On-premise Organizations.