Rounding Decimals Using Dynamic Expression Step
  • 12 Feb 2024
  • 1 Minute to read
  • Dark
    Light

Rounding Decimals Using Dynamic Expression Step

  • Dark
    Light

Article summary

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

Version6.10.1
Root FolderExample Lab - Rounding Decimals with Dynamic Expression Step
Modules None
DependenciesNone

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?