Way to truncate to specific amount of digits?
Comments
-
Is there a way to round numbers to a certain number of places in decisions as well as truncating the result to a certain number of digits?
-
We have a system flow called "set decimal places on number". You wont need to convert it to a string, you can pass a decimal into a string directly with no issue, but if need it to output as a decimal you could use the system flow "convert string to decimal" and that should do the trick of truncating the number to a certain number of digits. However, this step itself does not round mathematically, so you will need a "round" step beforehand. The attached image shows an example of this:

Relevant Links:[url=https://documentation.decisions.com/v8/docs/en/using-converter-flows?highlight=set decimal places]https://documentation.decisions.com/v8/docs/en/using-converter-flows?highlight=set decimal places[/url]
[i]edited by kobe.lee@decisions.com on 7/21/2023[/i]