web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to display a perce...
Power Apps
Unanswered

How to display a percentage in a form field?

(0) ShareShare
ReportReport
Posted on by 2,295

My form is connected to a Sharepoint list.

 

One of the fields is a number, I want to display it as a percentage (it is a tax rate).

 

The DataCard Format property is set to:

 

TextFormat.Number

 

There isn't an option to display this as percentage.

 

So, a tax rate of 0.23 just looks terrible on the form.

 

How can I display it like 23%?

 

Thanks

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at
    Text(0.5,"0%")
  • WebPortal Profile Picture
    2,295 on at

    @Drrickryp 

     

    Thanks, but Where do I type that? I mean, in which object and property?

     

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @WebPortal ,

    Here's an example of how it is used in a label_1.png

  • WebPortal Profile Picture
    2,295 on at

    @Drrickryp 

    I'm using a Form and there seems to be no way I can format the fields, they just display raw numbers, like 0.23

     

    For the user, this is annoying. It is better to type: 23%

     

    How do I do that?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    You can't easily format a textinput box but you can put "%" in a label next to it. You can format the result from the datasource later. A slider control is a slick way to input the number and you can put a % label next to it.

  • WebPortal Profile Picture
    2,295 on at

    Ok...

    I thought it was a trivial thing to do and I was missing something.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@WebPortal,

    Have you solved your problem?

    Based on the issue that you mentioned, do you want to format the TextInput control when you typing within?

    Could you please share a bit more about the scenario?

    I have a test on my side, please take a try as below.

    Set the OnChange property of the TextInput as follows:

     

    Set(var3,Value(DataCardValue8.Text)*100&"%")

     

    Set the Default property of the TextInput as follows:

     

    var3

     

    Note: Please do remember to set the Format of the TextInput as Number.

     Please check the following gif.

    123001Gif.gif

    Hope it could help.

    Regards,

    Qi

  • WebPortal Profile Picture
    2,295 on at

    @v-qiaqi-msft 

    Thank you, that solution almost solves the problem.

    It's not perfect, but it works.

    Ideally, the input should have a "mask" that forces the user to type the value as a percentage. This would facilitate UX. It is easier to type 23 (and see the decimal separator and % in the field as the numbers are typed) than to type .23 (and only see the percentage after the numbers are typed).

    Anyway, it will have to suffice.

     

    BTW: the same goes for other input fields, like phone numbers, email addresses, etc.

  • Lawrence_Sprou1 Profile Picture
    42 on at

    This does not work for existing data. It only works when one types in new data to the field.

    How can you get the current saved value to format properly? and save properly?

    It displays properly in the SharePoint List as 5%, but in Powerapps is displays as 0.5. 

    When I follow the instructions from this answer, existing values do not display, but new values display correctly. I have not tried to save them, because I do not want to overwrite the existing data, and is suspect that it may cause problems for the list as currently set up. 

    In order to improve the above complex solution, you would need to convert the existing data in the OnSelect Property of the Gallery to the proper format and assign it to the variable, then use the Update Property of the DataCard to convert it back for storage in the SharePoint List.  This worked for me, but there is a simpler solution that I used. I posted it as a separate answer.

  • Lawrence_Sprou1 Profile Picture
    42 on at

    The solution for me was to put this in the Default Property for the text input control: 

    Text(Parent.Default,"0.00%")

    This is on a form control so the Parent of the text box is the DataCard.

    If you are not using DataCards you could use whaterver your datasoucre item is. e.g. ThisItem

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard