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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Format input box with ...
Power Apps
Answered

Format input box with 1 decimal place

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,
I have a gallery with number type input boxes. I wanted the input box to auto update and format to only accept 1 decimal place while still in edit mode. How do I do that? Thank you.

 

Text(Value(ThisItem.Weight),"[$-en-US]#.0")

 

 

Categories:
  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    If you only want to see one decimal place immediately after the user has input the data - OnChange of the Text Box

    UpdateContext(
     {
     var1Decimal: 
     Round(
     Value(Self.Text),
     1
     )
     }
    );
    Reset(Self)

    Default of the Text Box (call the Variable whatever you wantg)

    var1Decimal

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

     

  • Ramole Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous 
    Try this simple formula please

    Text(Value(ThisItem.Weight),"#,###,##0.0")

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz,
    This work well when editing and it helped convert the value correctly, but unfortunately I have the input box/ textbox in a gallery. So, since Self.Text is used I noticed all rows for the weight are changed into the same value instead. How do I only change the specific row value?

    anonymia25_0-1646380354533.png

     

  • WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Anonymous ,

    Try on the Default

    If(
     ThisItem.IsSelected,
     var1Decimal
    )

    Note however you will need to reset this variable before the user selects another row. 

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz ,
    i have tried your solution above but apparently the weight is reset each time?
    gif_weight.gif

    Currently this is what I have on my Default: 

    If(
     ThisItem.IsSelected,
     var1Decimal, ThisItem.Weight
    )

     
    and i don't get what you mean by to reset the variable before the user selects another row. how do i apply that? 

  • Verified answer
    WarrenBelz Profile Picture
    156,748 Most Valuable Professional on at

    Hi @Anonymous ,

    With difficulty in a gallery if you want to work on more than one record   . . . you are wanting to reset a control in the gallery to a different value to the one input and the only way to do this is with a Variable. You can of course restrict the record to the one selected and it will work fine BUT if you select another record, the variable is still true AND the record is now selected, so it will reset as well (as you have discovered). I would simply save each record as you change them and reset the Variable to false when you save.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz,
    Thank you for your help! It worked finally and I did save each record by patching all the row items onChange and reset the variable to false right after the patch. :))

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 312

#3
Mohsin Ali Profile Picture

Mohsin Ali 252

Last 30 days Overall leaderboard