cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
milky_bar_may
Level: Powered On

Editable Form DataCard as number with comma seperator

Hi Everyone,

 

I have an editable form where the user is supposed to input numeric data on a DataCard.

 

For example if the user inputs 50000 the data is displayed in the DataCard as 50000 instead of the desired 50,000.

 

Is there a way to tell the PowerApp to treat the input as a number with the comma format?

 

Thank you all

 

Milky

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Editable Form DataCard as number with comma seperator

@milky_bar_may 

The functionality to pre-format numbers inside a text input does not currently exist for PowerApps.  Suggest you go submit a new idea here.

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

However, you can format numbers in a label like this similar to Excel.

Text(123456.789,"#,##0.00")

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Dual Super User
Dual Super User

Re: Editable Form DataCard as number with comma seperator

Hey @milky_bar_may 

 

There is no direct way to set the format of the typed inputs. As a workaround to this, you can set the configuration as either of the solutions below:

a) If you want the commas to appear when the user select/change the input. Basically on the OnSelect and OnChange property of the text input (OnChange gets triggered when the user clicks out of the control).
Default: MyInput
OnChange: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)
OnSelect: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)

Here, TextInput2 is the name of the control.

b) To automatically change this as soon as the input is entered.
You need to create a timer control as:
Timer:
OnTimerStart: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)
Repeat: true
Auto-Start: true
Duration: 100 (every 1/10 of a second)
Visible: false

TextInput: Default -> MyInput

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

6 REPLIES 6
Super User
Super User

Re: Editable Form DataCard as number with comma seperator

@milky_bar_may 

The best way to deal with this is to change the Text Input format to Number.  It will prevent the user from inputting any commas or other text characters.

 

textinput6.png

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

milky_bar_may
Level: Powered On

Re: Editable Form DataCard as number with comma seperator

Hi @mdevaney 

 

Thanks for the response.

 

I have the editable datacard formatted as a number.

 

However, when the input is entered it doesn't automatically pick up to format with the comma seperator. 

 

For example, if I input 5000 it stays at 5000 but does not change to 5,000 which is ideally what I would like to see. 

 

Thanks

 

Milky

Super User
Super User

Re: Editable Form DataCard as number with comma seperator

@milky_bar_may 

The functionality to pre-format numbers inside a text input does not currently exist for PowerApps.  Suggest you go submit a new idea here.

https://powerusers.microsoft.com/t5/Power-Apps-Ideas/idb-p/PowerAppsIdeas

 

However, you can format numbers in a label like this similar to Excel.

Text(123456.789,"#,##0.00")

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Dual Super User
Dual Super User

Re: Editable Form DataCard as number with comma seperator

Hey @milky_bar_may 

 

There is no direct way to set the format of the typed inputs. As a workaround to this, you can set the configuration as either of the solutions below:

a) If you want the commas to appear when the user select/change the input. Basically on the OnSelect and OnChange property of the text input (OnChange gets triggered when the user clicks out of the control).
Default: MyInput
OnChange: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)
OnSelect: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)

Here, TextInput2 is the name of the control.

b) To automatically change this as soon as the input is entered.
You need to create a timer control as:
Timer:
OnTimerStart: Set(MyInput,Text(Value(TextInput2.Text),"[$-en-US]###,###,###"));Reset(TextInput2)
Repeat: true
Auto-Start: true
Duration: 100 (every 1/10 of a second)
Visible: false

TextInput: Default -> MyInput

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Super User
Super User

Re: Editable Form DataCard as number with comma seperator

@yashag2255 

Interesting ideas you have for workarounds there.  I wish there was some other way than looping with a timer that never stops though.  Does having this timer looping constantly impact performance in any significant way?

milky_bar_may
Level: Powered On

Re: Editable Form DataCard as number with comma seperator

Wow! Big thanks @mdevaney and @yashag2255 

 

I really appreciate both your inputs and great ideas

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,634)