Issues with Rounding on Decimals

Issues with Rounding on Decimals

Comments

  • The rounding behaviour (Round Step) in Decision with the Roundup Option doesn’t seem to work for me, it does not round 0.5 up, but rather rounds it down instead - I need to round 0.5 up. Please see below the input/output.\r\n\r\nIs there any way we can solve this?\r\n\r\n{\r\n· INPUTS: {\r\no value: 554.625,\r\no decimalPlaces: 2,\r\no roundUpOption: 0\r\n},\r\n· OUTPUTS: [\r\n1. {\r\n§ path: \"Done\

  • Hi Leo,

    You could use the "Evaluate Dynamic Expression" step to do this. Ive attached a simple example demonstrating how this might look. Using your example, 554.625 will round to 554.63 in the attached export. This is done using the "Evaluate Dynamic Expression" step, using the expression:

    Round( {your_input_number} + 0.0000000001, 2)

    The syntax for the above expression is something like "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

    Let me know if you have any questions!
    -Ryan S.

Sign In or Register to comment.