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

Prevent User From Inputting a Decimal

Hi all,

 

I am having an issue where I need to be able to prevent a user from inputting a decimal "." inside of a DataCardValue input on a form within PApps 

 

I have tried the Text(Value(Parent.Default), "[$-en-US]#") formula. However that only changes the number that they inputted after the form is saved. I need to be able to prevent the user from inputting a decimal place at all. Or at the very least show a flag that warns that a decimal place was entered.

 

Any feedback will be very helpful. 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Prevent User From Inputting a Decimal

Hi @swan_soup ,

 

Do you want to prevent user to input decimal?

You can consider the following woraround,I test as next:

Add one textinput control and TextInput1.OnChnage:If(Value(TextInput1.Text)/Value(RoundDown(Value(TextInput1.Text),0))<>1, Notify("No need decimal,please try again!",NotificationType.Error);Reset(TextInput1))  (I use rounddown to test, you can consider use round or roundup based on your situation)

prevent decimal.PNG

test:

20190328preventdecimalgif.gif

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Prevent User From Inputting a Decimal

Hi @swan_soup ,

 

Do you want to prevent user to input decimal?

You can consider the following woraround,I test as next:

Add one textinput control and TextInput1.OnChnage:If(Value(TextInput1.Text)/Value(RoundDown(Value(TextInput1.Text),0))<>1, Notify("No need decimal,please try again!",NotificationType.Error);Reset(TextInput1))  (I use rounddown to test, you can consider use round or roundup based on your situation)

prevent decimal.PNG

test:

20190328preventdecimalgif.gif

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

swan_soup
Level: Powered On

Re: Prevent User From Inputting a Decimal

Hey Yumia,

 

That worked perfectly! 

Thank you so much. 

 

-swan

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 194 members 4,331 guests
Please welcome our newest community members: