In this Power Apps Tutorial, We will discuss how to format number as currency in PowerApps (format a Number Data type field to a Currency Data type field).
Also, We will see Power Apps format Number Decimal Places, Convert Date to Number in Power Apps, and Convert Date into Text format in Power Apps.
Format Number as Currency in Power Apps
Now, we will see how to format number as currency in PowerApps.
I have a SharePoint List named as “SharePoint Project Expenses“. This list has some columns with different data types as:
- Project Name (By default it is a Title Column)
- Number of User (Number Data type)
- Typical Software Costs (Currency Data type)
- User Licenses (Currency Data type)
- Created (Date and Time Data type)
Below screenshot represents the SharePoint list which has some records.
In the Powerapps screen, I want to show the records with proper Data type format.
For example, the above list is having two columns i.e. Typical Software Costs and User Licenses (both are in Currency data type format), So in the Powerapps screen, I want to display both of the columns with currency format only instead of a Number format.
To format the Number data type to Currency, follow these below steps:
- In the Powerapps Screen (Blank screen), Add an Edit or a Display form (Insert -> Forms -> Edit/Display).
- Select the Edit Form and go to the Properties tab (from the right section of the page). Add the Data Source as SharePoint (SharePoint Project Expenses) and add the required fields (from Fields section).
- Select the Edit form and apply the below formula on its Item property as:
Gallery1 = Previously I have created one Gallery control in other screen.
- Now you can see the records in each field. Here, you can see the Currency columns (Typical Software Costs and User Licenses) are appearing in the Number format.
- I want to convert this Number type format to Currency format.
- First, Select the Currency Data card and Unlock (Advanced -> Click on lock icon) as shown in the below screenshot.
- Now select the number Data card value from the Currency Data card and go to the Advanced tab (from the right section of the page).
- Apply the below formula in the Default field under the DATA section:
Default = "$" & Text(Parent.Default,"[$-en-US]0.00")
- When you will put “0.00“, PowerApps will automatically add the “[$-en-US]” prefix to your format.
- Also, you can directly apply this above formula on its Default property by using the formula bar.
Note:If you are using the Text input control or Label control instead of any Data card value, then you can use this below formula on its Text property as:
Text = “$” & Text(ThisItem.’Your Currency Field Name’, “[$-en-US]0.00”)
- Similarly, repeat these above steps for doing another currency field (User Licenses) which is showing in Number value.
- When you will preview the Powerapps form, then both of the Currency fields will display as like the below screenshot.
Power Apps format Number Decimal Places
Here, I will show you how to format Decimal Numbers in Powerapps. In the below screenshot (SharePoint List), you can see, there is a column named Typical Software Costs which is having some currency records.
Now I want to format all the Number Decimal Places. This means, suppose the first record is having “$10,560.59“, I want to make this value becomes “$10,560.6“.
Follow the below steps to format Number Decimal Places.
This below screenshot represents a Powerapps Gallery (Blank). This gallery screen is having only the Title and Subtitle fields. The Subtitle field is having the Currency field (Typical Software Costs).
I want to make this currency field as Decimal Places as like (10560.6).
Select the Subtitle and apply the below formula on its Text property as:
Text = Text(ThisItem.'Typical Software Costs', "#.#")
In the formula, When you will 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]#.#")
Typical Software Costs = Currency Field Name
Once you will preview the Gallery page, then you can see all the Currency value in the Decimal Format as shown below.
To get more information about the Powerapps format Number Decimal Places, you can refer this below Microsoft PowerApps link:
Convert Date to Number in Power Apps
Now we will see how to convert Date to Number format in Power Apps.
The below screenshot represents a Powerapps Gallery (Blank). This gallery screen is having the Title, Subtitle, and Body fields. The Body field is having the Date picker Value (Created Date).
I want to make this Date field as a Number field in Powerapps Gallery.
Select the Body (Created) and apply the below formula on its Text property as:
Text = Text(ThisItem.Created,"[$-en-US]yyyymmdd")
- Text = Body Propert Name
- ThisItem.Created = Date Picker field
- “yyyymmdd” = The Date picker will convert into Year, Month and Day format with a Number value
In the formula, When you will put “yyyymmdd“, PowerApps will automatically add the “[$-en-US]” prefix to your format to tell the system what locale format to use.
Convert Date into Text in Power Apps
Now I want to show how to convert the Date Picker into a Text format in Powerapps.
Suppose my Date picker field value is like “06/01/2020“, I want to make it becomes like “1 June 2020“. Follow the below formula.
As like the above one (Convert Date to Number), In the same way, Select the Body part from the Gallery and apply the below formula on its Text property as:
Text = Text(ThisItem.Created,"[$-en-US]dd mmmm yyyy")
Now you can see the Date format will change into “01 June 2020” as shown in the below screenshot.
Also, you may like the below Powerapps tutorials:
- Various PowerApps Validation Examples
- PowerApps charts (Column, Line and Pie Chart)
- How to use List Screen in PowerApps
- How to create PowerApps collection from Excel
- PowerApps Collection: Add, Update, Remove and Filter items
- How to display images from a SharePoint Online library in PowerApps
In this Power Apps Tutorial, We discussed how to format number as currency in PowerApps.
Also, We saw Power Apps format Number Decimal Places, Convert Date to Number in Power Apps, and Convert Date into Text format in Power Apps.
I am Bijay a Microsoft MVP (8 times – My MVP Profile) in SharePoint and have more than 15 years of expertise in SharePoint Online Office 365, SharePoint subscription edition, and SharePoint 2019/2016/2013. Currently working in my own venture TSInfo Technologies a SharePoint development, consulting, and training company. I also run the popular SharePoint website EnjoySharePoint.com