Rounding Decimals Using Dynamic Expression Step
- 12 Feb 2024
- 1 Minute to read
- Print
- DarkLight
Rounding Decimals Using Dynamic Expression Step
- Updated on 12 Feb 2024
- 1 Minute to read
- Print
- DarkLight
Article summary
Did you find this summary helpful?
Thank you for your feedback
Example Lab Article
While Example Lab projects are resources for public use, articles and assets are not actively maintained. Screenshots and features are from the specified version below. These references may become dated as new versions are released.
Overview
Example Lab Details | |
Version | 6.10.1 |
Root Folder | Example Lab - Rounding Decimals with Dynamic Expression Step |
Modules | None |
Dependencies | None |
This Example Lab demonstrates how to use the Evaluate Dynamic Expression Step in order to round a number up if it is .005 or round the number down if it's .004.
Explanation
This Flow utilizes the Evaluate Dynamic Expression Step, which is setup to round up when a decimal is .005 and down when its .004. This is done using the expression: Round( {your_input_number} + 0.0000000001, 2). The syntax for the above expression is seen as "Round ( number, decimal_places )." This adds a tiny decimal number, "0.00000001," so that the normal rounding behavior should persist (554.624 will round down to 554.62), but 554.625 will round up to 554.63.
Reference Articles
Project Download
The examples attached were developed to be instructional and were not developed as officially supported components. For more information or to engage our service team to develop fully supported, production-quality solutions, please contact services@decisions.com. Import the project below to a Decisions environment on version 6.10.1 or later using our Importing/Exporting article.
Was this article helpful?