Wednesday, 20 December 2023

Power Apps Currency Format - Canvas App currency comma separated like excel - CanvasApp Formulas

 

Power Apps Currency Format


Do you know how to format a number to currency in Power Apps? No issues!

This Power Apps tutorial will help you learn how to use the Power Apps currency format, its syntax, and features.

Also, we will see how to format numbers as currency in Power Apps and many more like:

  • Format number decimal places in Power Apps
  • Power Apps currency format with commas
  • How to format currency Euro in Power App





  • Power Apps Currency Format

The method by which numerical numbers are shown to represent monetary quantities in Power Apps is referred to as the currency format. The proper currency sign, decimal places, and maybe separators for thousands are usually included in this format.

The table below represents different aspects of currency formatting in Power Apps:

FeatureDescriptionExample
Currency SymbolIncorporates the currency symbol into the display of monetary values.$, €, £
Decimal PlacesSets the number of decimal places, typically two for currency.1234.56 → $1,234.56
Thousand SeparatorUses commas or other separators for easier readability of large numbers.1000000 → $1,000,000
Locale-Based FormattingFormats currency according to the user’s regional settings, affecting symbol placement, decimal, and thousands of separators.US: $1,234.56, France: 1 234,56 €
Custom FormattingEnsures proper data types like numbers or decimals for accurate currency representation and calculations.$#,###.00 → $1,234.56
Data TypesEnsures proper data types like numbers or decimals for accurate currency representation and calculations.Number, Decimal
Formatting FunctionsUtilizes functions like Text formatting numbers as currency. The format can be specified in the function.Text(1234.56, "$#,###.00")
ConsistencyMaintains uniform currency formatting across the app for clarity and professionalism.All currency displayed as $#,###.00

Syntax:

Below is the syntax of the Power Apps currency format:

Text(35653, “$#,##0.00”)

Power Apps converts 35653 [number] into a structured text string representing a currency value.

Where,

  • Text = Power Apps Text function is used to convert a value to a formatted text string
  • 35653 = Specify the number you want to format as currency

Let’s discuss a simple scenario.

Example:

1. The image below represents a Text input and Label control. Any number the user enters in the text box will be converted to currency format.

Power Apps Currency Format

2. To work with this, select the label control and set its Text property to the code below:

Text = Text(
    Value(txtNumber.Text),
    "[$-en-US],$#,###.00"
)

txtNumber = Text input control name where the user will enter the number

powerapps currency format

3. Save, publish, and preview the app. Enter any number in the text box. The number’s value will be converted to currency and displayed in the label control.

This is how to work with Power Apps currency format.

Power Apps Format Number As Currency

Here, we will discuss how to format a number as a currency in Power Apps.

The screenshot below represents a Power Apps Gallery control and an Edit form. When a user selects any particular item from the gallery, the field values will display in the edit form.

But the Currency field [Course Fee] will appear as a number value instead of a currency value. After converting the number as a currency, the field will look like the image below.

powerapps format number as currency

To achieve this, follow the instructions below:

1. I have a SharePoint list named Course Evaluation Details. This list has these many fields below:

ColumnDatatype
TitleSingle line of text
Course DescriptionMultiline of text
Single InstructorPerson
Course FeeCurrency

Refer to the figure below.

Power Apps Format Number As Currency

2. Next, in Power Apps, insert a Gallery control [+ Insert -> Vertical gallery] and set its Items property as:

Items = 'Course Evaluation Details'
powerapps format currency

3. Add an Edit form [+ Insert -> Edit form] and set its DataSource property to the SharePoint list:

DataSource = 'Course Evaluation Details'
powerapps format as currency

4. On the Edit form’s Item property, write the formula below:

Item = galCourseDetails.Selected

Where,

galCourseDetails = Gallery control name

power apps format currency

5. To convert the Number field to currency, select the field [Course Fee] from the edit form and apply the Default property as:

Default = "$" & Text(
    Parent.Default,
    "[$-en-US]0.00"
)

Power Apps will automatically prefix your format with “[$-en-US]” when you enter “0.00“.

NOTE:

Use the following formula on the Text property of the Text input control or Label control in place of any Data card value:
Text = “$” & Text(ThisItem.’Your Currency Field Name’, “[$-en-US]0.00”)
currency format powerapps

6. Save, publish, and preview the app. Select any item from the gallery, then the item details will appear in the edit form, and the Course Fee field will display with the currency format.

This is how to format numbers as currency in Power Apps.

Power Apps Format Number Decimal Places

In Power Apps, I’ll demonstrate how to format decimal numbers. The Typical Software Costs column in the SharePoint List picture below includes several currency records.

I want to format every number in decimal places right now. In other words, if the value in the first record is “$10,560.59“, I want to change it to “$10,560.6“.

Powerapps format Number Decimal Places

Follow the below steps to format Number Decimal Places.

1. The screenshot below represents a Power Apps Gallery Control. This gallery screen has only the Title and Subtitle fields. The Subtitle field has the Currency field (Typical Software Costs).

I want to make this currency field like Decimal Places (10560.6).

Power apps format Number Decimal Places

2. Select the Subtitle label field and apply the below formula on its Text property as:

Text = Text(ThisItem.'Typical Software Costs', "#.#")

In the formula, When you put “#.#“, PowerApps will automatically add the “[$-en-US]” prefix to your format to tell the system what locale format to use. Then the formula looks like as below:

Text = Text(ThisItem.'Typical Software Costs', "[$-en-US]#.#")

Where,

Typical Software Costs = Currency Field Name

powerapps format number decimal place

3. Save, publish, and preview the app. You can view all the Currency values in the Decimal Format in the gallery.

This is how to format number decimal places in Power Apps.

Power Apps Currency Format With Commas

Here, we will work with Power Apps Currency Format With Commas.

A Power Apps Gallery control displays the currency value from the SharePoint list. To work with this, select the gallery and set its Text property as:

Text = Text(
    ThisItem.'Course Fee',
    "[$-en-US]$ #.00"
)

Course Fee = SharePoint Currency Column

Power Apps Currency Format With Commas

This is how to work with Power Apps currency format with commas.

Power Apps Format Currency Euro

Here, we will see how to format the currency value to Euro value in Power Apps.

You can see there is a Text input control and a Label control. Any number the user enters in the text field will be converted to euros and shown in the label below.

Power Apps Format Currency Euro

1. To do so, select the label control and set its Text property to the formula below:

Text = Text(
    Value(txtNumber.Text),
    "[$-en-US],€###,###.00"
)

Where,

txtNumber = Text input control name

powerapps format currency euro

2. Save, publish, and preview the app. Enter any number in the text box. The number’s value will be converted to Euro currency and displayed in the label control.

This is how to work with Power Apps Format Currency Euro.

Conclusion

This Power Apps tutorial taught us how to use the Power Apps currency format, its syntax, and features.

Also, we saw how to format numbers as currency in Power Apps and many more like:

  • How to format number decimal places in Power Apps
  • Working with Power Apps currency format with commas
  • Format currency Euro in Power Apps

No comments:

Post a Comment

Power Apps Drag & Drop Kanban code sample

  Introduction: The Kanban Board App Developers at a software company use the Kanban board to show their progress on development tasks and b...