cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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
Highlighted
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

Highlighted
Dual Super User III
Dual Super User III

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
Highlighted
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."

Highlighted
Helper IV
Helper IV

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

Highlighted
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

Highlighted
Dual Super User III
Dual Super User III

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

Highlighted
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?

Highlighted
Helper IV
Helper IV

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
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,811)