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

Text input mode - number, blocked decimal comma

Hi,

 

I'm building an app where I need a decimal number from an user. I've tried setting the textinput's mode to Number to make things easier, but some users have reported that the button for decimal comma or dot is disabled:decimal.jpg

 

Is there anything else I have to enable, to allow users to input decimal numbers?

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

You can modify your regex as: 
 
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*([.,]\d+)?$"),false,true))
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

4 REPLIES 4
Dual Super User
Dual Super User

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

Currently Text Input controls only supports two formats, Text and Number and there are few restriction on various devices types over the keyboard controls.
 
If you want user to restrict to only enter decimal points, as a workaround you can follow the below mentioned steps:
 
1) Keep the Text Format to Text.
2) Set the OnChange property of your Text Input( lets say TextInput1) as:
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*(\.\d+)?$"),false,true))
3) Set the "reset" property of your text Input as: 
resetvar
 
This will reset the control if user has given value that is not a decimal.
 
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!
jernejp
Level: Powered On

Re: Text input mode - number, blocked decimal comma

Thank you for your answer. Can you help me modify the regex to include a comma or a dot?

So the user can use 1,5 or 1.5 (as we use a comma in our language to seperate the decimal)

Dual Super User
Dual Super User

Re: Text input mode - number, blocked decimal comma

Hi @jernejp 

 

You can modify your regex as: 
 
Set(resetvar,false);Set(resetvar,If(IsMatch(TextInput1.Text,"^[1-9]\d*([.,]\d+)?$"),false,true))
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
jernejp
Level: Powered On

Re: Text input mode - number, blocked decimal comma

Perfect, thank you!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,359)