Announcements
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")
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
Hi @Anonymous Try this simple formula please
Text(Value(ThisItem.Weight),"#,###,##0.0")
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?
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.
Hi @WarrenBelz ,i have tried your solution above but apparently the weight is reset each time?
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?
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.
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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 345 Super User 2026 Season 2
M Bilal Khan 312
Mohsin Ali 252