How To Convert Floating Point Number to Nearest Integer & also Round Up || Down By Power Automate
How To Convert Floating Point Number to Nearest Integer & also Round Up || Down By Power Automate
How to Round (Up; Down) Decimal in Power Automate
Decimal numeric Round-off is a renowned Math operation, that will always be a necessity while working with numbers irrespective of their complexity.
When it comes to the Canvas app, we have multiple built-in methods available for Rounding a decimal namely Round, RoundDown and RoundUp.
Round(Number, DecimalPlaces)
RoundDown(Number, DecimalPlaces)
RoundUp(Number, DecimalPlaces)
We also have scenarios to round off the decimal values in Power Automate. But, to our surprise, Microsoft has no specific function provided in the expressions, instead, we will have to use an action named “Format Number” under the “Number Functions” category.
Format number only does a Round function in a traditional way by rounding up if the decimal digit is 5 or higher. Otherwise, this function rounds down. For Instance: 1.1 to 1, 1.5 to 2.
This Format Number action enables us to perform a variety of number formatting options easily by leveraging number formatting patterns like other Power Platform services. Formatting a number includes a custom format, which is used to Round up a decimal value to an integer just by specifying “#” in the format field. This action also can
- Format the appearance of the number based on typical patterns such as Currency($) formats.
- Custom formatting patterns likely to Excel, Power BI and Power Apps expressions.
- Try currency formats as per the business requirements, specific to locales.
- Also formats C2 (currency with two decimal places), and N2 (negative number with two decimal places).
For a customized Round up option like 1.1 -> 2;
1.5 -> 2, a manual arithmetic expression should be built within the variable action.
sub(outputs('Round_Up_for_Double_Digits'),1)
FLOW DOWNLOAD LINK - Convert_Floating_Point_Number_Integer_Round_UP_Down_20231031174205.zip
✨ Thanks for reading! ✨
I hope you found this blog on the Microsoft Power Platform helpful! From Power Apps, Power Automate (Cloud & Desktop), Canvas Apps, Model-driven Apps, Power BI, Power Pages, SharePoint, Dynamics 365 (D365), Azure, and more, I cover a wide range of topics to help you harness these powerful tools. Don’t miss out on future tips, tutorials, and insights—hit that subscribe button to get the latest posts right to your inbox. 💌
💬 I’d love to hear your thoughts! Drop a comment below with your questions, ideas, or feedback—let’s get the conversation started!
🔗 Let’s connect and grow together!
Follow me, Ravindra Jadhav, on your favorite platforms for even more content and updates on Microsoft Power Platform and related technologies:
- 💼 LinkedIn – Let’s network and share ideas!
- 💻 GitHub – Explore my projects and code.
- 🐦 Twitter – Stay updated with quick tips and industry news.
- 📺 YouTube – Watch tutorials and deep dives on Power Platform, Power Apps, Power Automate, and more!
Let’s build something amazing together with Power Platform and Azure! 🚀
Comments
Post a Comment