# How To Format A Number In Power Automate [Many Examples] The way numbers need to be displayed varies on the context. Prices with different currencies need a different format than serial numbers with leading zeros. The Power Automate Format Number action and the interchangeably usable Power Automate formatNumber function simplifies formatting numbers.

• How to use the Power Automate Format Number action
• How to use the Power Automate formatNumber function in expressions
• How to formulate format patterns according to your needs (lots of examples)

## How To Use The Power Automate Format Number Action

Let’s format a number to the common US format for a dollar price. As an example, we will format 34800.67 to \$34,800.67.

1. #### Create a new flow with a manual trigger New flow

2. #### Add a Format Number action Power Automate – Format Number action

3. #### Configure Format Number action: Number = 34800.67, Format = select \$1,234.00 and Locale = select English (United States) (en-US) Power Automate – Format Number action

4. #### Run the Format Number action flow Power Automate – Format Number action – Result Test Run

power automate format number

## Power Automate FormatNumber Function

The formatDate function does the same as the Format Date action. A given number is formatted based on a format and a locale to formatted string.

### Syntax

``formatNumber(number : number, format: string, locale?: string)``

#### Parameters

• number (required): The number that needs to be formatted.
• format (required): The format that should be applied to format the number.
• locale (optional): The locale that is used to format the number.

#### Return value

• Returns the formatted number as a string that is formatted based on format and locale.

## Power Automate Format Number Patterns

To format a number you need to provide a format. Formulating this format is for sure the hardest part.

We will show you the options you have for formulating formats and provide a lot of examples.

To define the number format you can use:

• Standard formats for Currency, Digits, Exponential, Float, Hexadecimal, Number or Percent
• Custom format

Below you will find explanations and examples of each format.

In most cases the Power Automate Format Number examples below are self-explanatory.

### Currency

To define the format of for a currency there is the standard C format. Simply use C followed by the number of decimal places you need.

If you only provide C as format you will get the default format C2.

Provide a locale to formatNumber to get the correct currency and format for the given locale.

### Digits

It is quite common to have numbers that need to have certain number of digits. To provide the needed number of digits leading zeros are often used to fulfil the needed length. The standard format D followed by the number of digits you need ensures the rigth number of digits.

### Exponential

To format a number in exponential notation use the standard format E.

### Float

You want to format a number with predefined number of decimal places, use the standard format F followed by the needed number of decimal places.

#### Examples: Format number as a float

To format a number in hexadecimal use the standard format X.

### Number

To format a number with a thousand separator and a configurable number of decimal places use the standard format N.

### Percent

The standard format P lets you display a number as a percentage.

### Custom Format

Sometimes the standard formats do not fit your needs. This is where custom formats come in.

By combining multiple placeholders you can define your own format.

Here is a list of the most common placeholders.

You might wonder how to use them. Below there is at least one example for every placeholder.

### 1 thought on “How To Format A Number In Power Automate [Many Examples]”

1. thanks 🙏