Skip to main content
Power Automate
    • Robotic process automation
    • Power Automate Desktop
    • Process advisor
    • AI Builder
    • Connectors
    • Templates
  • Pricing
    • Blog
    • Documentation
    • Roadmap
    • Self-paced learning
    • Webinar
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • Register
    • ·
    • Sign In
    • ·
    • Help
    Go To
    • Microsoft Power Automate Community
    • Community News
    • News & Announcements
    • Get Help with Power Automate
    • General Power Automate Discussion
    • Connecting To Data
    • Building Flows
    • Using Flows
    • Power Automate Desktop
    • AI Builder
    • Power Automate Mobile App
    • Translation Quality Feedback
    • Share, Chat, Discuss
    • Community Chat & Announcements
    • Power Automate Cookbook
    • Off Topic Discussion
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Watch & Share Videos
    • Webinars and Video Gallery
    • MBAS Gallery 2019
    • MBAS Gallery 2020
    • Give Feedback & Share Ideas
    • Power Automate Ideas
    • Report Issues
    • I Found A Bug
    • Find & Join Local User Groups
    • Power Automate User Groups
    • Read & Share Blogs
    • Power Automate Community Blog
    • Community Blog Topic Suggestions
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power Automate Community
    • Forums
    • Share, Chat, Discuss
    • Power Automate Cookbook
    • Round off to two decimal places using Power Automa...

    Round off to two decimal places using Power Automate

    01-08-2020 11:13 AM

    Dual Super User II yashag2255
    Dual Super User II
    2154 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    yashag2255
    Dual Super User II yashag2255
    Dual Super User II
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    Round off to two decimal places using Power Automate

    ‎01-08-2020 11:13 AM

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

    Preview file
    19 KB
    Roundoffdecimalplaces_20200108191138.zip
    Labels:
    • Labels:
    • Button Flows
    Message 1 of 3
    2,154 Views
    3 Kudos
    Reply
    • All posts
    • Previous Topic
    • Next Topic
    betterpractices
    betterpractices
    New Member
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎06-05-2020 09:21 AM

    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

    Message 2 of 3
    1,612 Views
    0 Kudos
    Reply
    betterpractices
    betterpractices
    New Member
    In response to betterpractices
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Email to a Friend
    • Report Inappropriate Content

    ‎06-07-2020 02:38 AM

    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

    Message 3 of 3
    1,600 Views
    0 Kudos
    Reply

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Automate
    • Power Virtual Agents
    • Sign up free
    • Sign in

    Browse

    • Templates
    • Connectors
    • Partners

    Downloads

    • Mobile
    • Gateway

    Learn

    • Documentation
    • Learn
    • Support
    • Community
    • Give feedback
    • Blog
    • Pricing
    • © 2021 Microsoft
    • Twitter
    • RSS Feed
    • YouTube
    • Contact us
    • Trademarks
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Terms & conditions