2 Ways to Format a Number as Currency in Power Automate

Do you need to format numbers in Power Automate as a currency?

Adding a currency format to numbers can be very helpful for anyone consuming the results as the currency format will help to distinguish these numbers.

Displaying numbers in a clear and concise manner is important, and using currency format is a great way to achieve this. This format helps to eliminate confusion by emphasizing the currency type and making it easy to understand the value being represented.

When dealing with large numbers, things can quickly become confusing when trying to read and understand the amount. Currency format allows for the placement of a thousand separators every three digits to make the number easier to read.

Additionally, the currency format can include the symbol for the given currency, which avoids any potential confusion about which type of currency is being used.

By including these formatting elements, currency format ensures that numbers are easy to read and understand, even in complex financial situations.

This post will show you how to format numbers as a currency in Power Automate.

Key Takeaways

  • Power Automate provides a useful formatNumber function to convert numbers to currency format.
  • It enables you to customize currency symbols, thousand separators, decimal places, and locale settings for a better user experience.
  • Proper currency formatting in Power Automate improves the readability and understanding of financial data.

Formatting Numbers as Currency

In Power Automate, you can format numbers as currency using two main approaches: The Format Number Action and the FormatNumber Function.

This section will guide you through both methods, giving you the knowledge needed to apply the right formatting for your specific use case.

Format Numbers as Currency with the Format Number Action

The Format Number Action allows you to easily format numeric values as currency within your Power Automate flows. Follow these steps to use the action.

  1. Add the Format number action to your flow.
  2. Configure the action by entering the number to be formatted in the Number field. This can be a dynamic content reference.
  3. Selecting the desired format $1,234.00 for currency from the Format setting.
  4. Select the appropriate Local setting. For example, English (United States) (en-US).

📝 Note: Selecting $1,234.00 from the Format dropdown won’t necessarily use a dollar sign, a comma as a thousand separator, and a point as a decimal separator. These are determined by the Locale selected.

Now when you run the flow, numbers will be formatted according to the currency formatting standards for the chosen locale setting.

Here is an example of configuring the Format number action with the en-US locale.

  • Number: 1234567.89
  • Locale: English (United States) (en-US)
  • Output: $1,234,567.89

Here is an example of configuring the Format number action with the fr-LU locale.

  • Number: 1234567.89
  • Locale: French (Luxembourg) (fr-LU)
  • Output: 1.234.567,89 €

Notice the output can be quite different depending on the locale. The fr-LU locale produces a Euro symbol at the end of the number, uses dots as thousand separators, and a comma as a decimal separator.

Format Numbers as Currency with the formatNumber Function

Another approach to formatting numbers as currency in Power Automate is by using the formatNumber function within expressions.

The syntax for the formatNumber function is as follows.

formatNumber(number, format, locale)
  • number: The numeric value you want to format.
  • format: The desired currency format, such as '$#,##0.00'.
  • locale: The locale code, like 'en-US' for English (United States).

To use the formatNumber function in your flow you can follow these steps.

  1. Click into the field where you want to use the formatted number.
  2. Click on the Expression tab in the popup.
formatNumber(outputs('Compose'),'$ #,##0.00','en-US')
  1. Add the above expression into the formula editor where outputs('Compose') is a dynamic content reference to the number you want to format.
  2. Press the Ok button.

The function will format the given number based on your specified currency format and locale.

formatNumber(1234567.89, '#,##0.00 €', 'fr-LU')

Above is an example of how to apply the formatNumber function for the :

With these methods, you easily format numbers as currency in your Power Automate flows.

Customizing the Currency Format

Selecting a Locale

A locale represents the conventions, language, and cultural information that the currency formatting depends on.

Power Automate uses standard locales with the formatNumber function and Number format action.

formatNumber(<number>, 'C2', 'en-US')

In this example, 'en-US' is the locale for the United States, specifying that the currency formatting should follow the rules for the US Dollar.

Replace 'en-US' with the appropriate locale for your desired currency.

Setting Decimal Places

Once you’ve selected a locale, you can specify the desired number of decimal places for the currency format by modifying the format parameter.

formatNumber(<number>, 'C2', 'en-US')

For example, to set two decimal places, use the 'C2' format. Replace the 2 in 'C2' with the number of decimal places you want to display.

Using Custom Formats

In addition to the built-in currency formats, Power Automate allows you to create custom formats for your currency.

You can control the thousand separator, decimal separator, and currency symbol by using custom format strings. Here’s an example of a custom format string:

formatNumber(<number>, '#,##0.00 $', 'en-US')

In this example, the format string #,##0.00 $ includes these features.

  • #,##0 – Defines a thousand separators as a comma.
  • 0.00 – Sets the decimal separator as a period and defines the number of decimal places to be two.
  • $ – Represents the currency symbol placeholder and can be placed at the start or end of the number with or without spaces between the number and symbol.

You can replace any of these elements in the format string to customize the currency formatting to your needs.

Remember to also adjust the locale as necessary. By combining these techniques, you can create a wide variety of currency formats tailored to your specific requirements in Power Automate.

Conclusion

You can easily format a number as currency using the formatNumber function or the Format number action. Both methods offer you flexibility in customizing the appearance of your data.

With the formatNumber expression, you can create your own custom format or use standard formats. Just input the number, select a format, and define a locale. It provides you with a wide range of options that cover various currencies and locales.

The Format number action is another tool that helps you achieve the same goal. It allows you to choose from predefined formats or create a custom one, and is essentially a more user friendly version of the formatNumber function.

Properly formatting your data in Power Automate not only enhances readability but also ensures accuracy, making it easier for you and your teammates to work with large numbers effectively.

Do you format your numbers as currency in your flows? Let me know in the comments!

About the Author

John MacDougall

John MacDougall

John is a Microsoft MVP and freelance consultant and trainer specializing in Excel, Power BI, Power Automate, Power Apps and SharePoint. You can find other interesting articles from John on his blog or YouTube channel.

Related Articles

Comments

1 Comment

  1. Susan Holder

    My data is coming in as text. How do I get it to convert from text to currency.

    My data source is Power BI.

Get the Latest Tech Tips

Write For Us

Are you a tech enthusiast with a talent for writing great content? Come write for us!

Follow Us

Follow us on social media to stay up to date with the latest in tech!