cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

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

 

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

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

 

View solution in original post

Highlighted
Frequent Visitor

Re: Prevent User From Inputting a Decimal

Hey Yumia,

 

That worked perfectly! 

Thank you so much. 

 

-swan

Highlighted
New Member

Re: Prevent User From Inputting a Decimal

Hi,

 

How to restrict upto 4 decimals. The text box should not accept beyond 4 decimals while entering.

Can you help me.

 

Thank you in advance.

 

Helpful resources

Announcements
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

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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