{"id":78,"date":"2024-09-06T11:39:41","date_gmt":"2024-09-06T18:39:41","guid":{"rendered":"https:\/\/gilosoftblogcom.wordpress.com\/?p=78"},"modified":"2024-09-06T11:39:41","modified_gmt":"2024-09-06T18:39:41","slug":"using-format-number-function-in-power-automate","status":"publish","type":"post","link":"https:\/\/blog.gilosoft.com\/index.php\/2024\/09\/06\/using-format-number-function-in-power-automate\/","title":{"rendered":"Using Format Number function in Power Automate"},"content":{"rendered":"\n<p>Power Automate, formerly Microsoft Flow, enables the automation of repetitive tasks through custom workflows. Among its key features is the&nbsp;<code>formatNumber<\/code>&nbsp;function, which allows for precise number formatting. In this blog post, we\u2019ll demonstrate how to utilize the&nbsp;<code>formatNumber<\/code>&nbsp;function to format numerical values effectively within your workflows.<\/p>\n\n\n\n<p><strong>What is the Format Number Function?<\/strong><\/p>\n\n\n\n<p>The &#8216;<code>formatNumber'<\/code>&nbsp;function in Power Automate is used to format a number into a string representation based on a specified format. This function is particularly useful when you need to ensure numbers are displayed in a consistent and readable manner, such as formatting currency values, percentages, or adding leading zeros.<\/p>\n\n\n\n<p>Syntax of the Format Number Function<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nformatNumber(number, format)\n<\/pre><\/div>\n\n\n<p>Where &#8216;<code>number'<\/code>&nbsp;is the numerical value you want to format, and&nbsp;<code>format<\/code>&nbsp;is the string that defines the formatting pattern.<\/p>\n\n\n\n<p><strong>Step-by-Step Guide to Using the Format Number Function in Power Automate<\/strong><\/p>\n\n\n\n<p><strong>Step 1:<\/strong> Create New Flow<\/p>\n\n\n\n<p>Go to Power Automate (<a href=\"https:\/\/make.powerautomate.com\/\">flow.microsoft.com<\/a>) and create a instant cloud flow with a manual trigger. After you have created a title select &#8220;Create&#8221; to begin building the flow.<\/p>\n\n\n\n<p><strong>Step 2:<\/strong> Initialize Variables<\/p>\n\n\n\n<p>Add a new action, &#8220;Initialize variable&#8221;, to store the number you want to format<br>Set the name to &#8216;numberToFormat&#8217;, type to &#8216;Float&#8217;, and provide a sample value<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-16-at-2.54.11%E2%80%AFPM-1024x444.png\" alt=\"\" class=\"wp-image-2293\" \/><\/figure>\n\n\n\n<p><strong>Step 3:<\/strong> Format Number Function in Compose Action<\/p>\n\n\n\n<p>Add a &#8220;Compose&#8221; action to use the &#8216;formatNumber&#8217; function<br>Set the input to the following expression to format the number as percentage with two decimal places:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nfomatNumber(variables('numberToFomat'), 'P2')\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-16-at-3.00.15%E2%80%AFPM.png\" alt=\"\" class=\"wp-image-2295\" \/><\/figure>\n\n\n\n<p><strong>Step 4:<\/strong> Output the Result<\/p>\n\n\n\n<p>Add a new action, &#8220;Compose&#8221;, to output the formatted number.<br>Set the input to the result of the previous &#8220;Compose&#8221; action.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/gilosoft.com\/wp-content\/uploads\/2024\/07\/Screenshot-2024-07-16-at-2.56.42%E2%80%AFPM-1024x647.png\" alt=\"\" class=\"wp-image-2294\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>Power Automate, formerly Microsoft Flow, enables the automation of repetitive tasks through custom workflows. Among its key features is the&nbsp;formatNumber&nbsp;function, which allows for precise number formatting. In this blog post, we\u2019ll demonstrate how to utilize the&nbsp;formatNumber&nbsp;function to format numerical values effectively within your workflows. What is the Format Number Function? The &#8216;formatNumber&#8217;&nbsp;function in Power Automate [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":80,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-78","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-power-automate-text-functions"],"_links":{"self":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts\/78","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/comments?post=78"}],"version-history":[{"count":0,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/posts\/78\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media\/80"}],"wp:attachment":[{"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/media?parent=78"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/categories?post=78"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.gilosoft.com\/index.php\/wp-json\/wp\/v2\/tags?post=78"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}