Skip to main content

Notifications

Community site session details

Community site session details

Session Id :

Round off to two decimal places using Power Automate

 Profile Picture Posted 08 Jan 2020 by Community member

This Flow takes a float value as an input and appropriately rounds off to two decimal places. 

Categories:

Comments

  • jiwhite Profile Picture jiwhite 498
    Posted 31 Mar 2023 at 18:01:08
    Round off to two decimal places using Power Automate

    Use Format Number to round your number into a string, then convert the string back to a number.

     

    jiwhite_0-1680285606858.png

     

  • hemrhk Profile Picture hemrhk 361
    Posted 05 Jan 2022 at 11:13:41
    Round off to two decimal places using Power Automate

    This blog post solves Round off problems

    https://365stack.in/index.php/2022/01/01/how-to-round-up-down-decimal-in-power-automate/ 

     

    Follow 365 Stack for more updates.

  • betterpractices Profile Picture betterpractices
    Posted 07 Jun 2020 at 09:38:28
    Round off to two decimal places using Power Automate

    In an attempt to fix the two issues mentioned, I stumbled upon a third issue - the approach taken to rounding is basically not correct, as it always rounds every number in reverse one by one.

     

    This issue can be seen if you try to round 0.4949 to two decimal places - the correct result is 0.49, however the flow will return 0.50. 

     

    The reason why the flow returns 0.50 is that it always rounds the last decimal place:

    - Step 1: 0.4949 is rounded to 0.495

    - Step 2: 0.495 is rounded to 0.50

  • betterpractices Profile Picture betterpractices
    Posted 05 Jun 2020 at 16:21:20
    Round off to two decimal places using Power Automate

    I was looking for a Power Automate equivalent to Excel's Round() function, when I stumbled upon this - at first it looked great, but after some testing, I have found two issues:

     

    1. it cannot handle numbers that have fewer decimal places than you're trying to round off to (i.e. the number of decimal place you check against in the "Do until" action)

    2. it doesn't correctly handle numbers where the first decimal place is a 0 

     

    Example 1:

     

    enter 1.1 (where the Do until action is trying to round to 2 decimal places)

     

    results in the flow failing

     

     

    Example 2:

     

    enter 1.0126543678992 

     

    the result returned by the flow is 1.126544

    the correct result should have been 1.012654