web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

undefined

(0) ShareShare
ReportReport
Posted on by 37

I have a gallery where I am using a text box that accept only number, I want to restrict user upto 2 decimal places while entering the number , is there any way?

Categories:
  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @dipanjan2021,

    Do you want to restrict 2 decimal places while entering the numbers?

    You can set the OnChange of text input as:

     

    If(!IsMatch(TextInput1.Text,"\d+(\.\d{0,2})?"),Notify("Please enter two decimal places"),NotificationType.Error)

     

    vmingkzmsft_0-1689743738162.png

     

     

    Best Regards,

    Kyrie

  • dipanjan2021 Profile Picture
    37 on at

    Hi thanks for the quick response

    My actual requirement is if user put any number beyond 2 digits after decimal point it should not reflect

  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    @dipanjan2021,

    What do you mean about it should not reflect?

    If the number beyond 2 decimal places then clear the text input?

    If so, please try this.

    If(!IsMatch(TextInput1.Text,"\d+(\.\d{0,2})?"),Reset(TextInput1))

     

     

  • dipanjan2021 Profile Picture
    37 on at

    No actually not like that. 2 digits after decimal point it will stop taking input although deletion is possible 

  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    @dipanjan2021,

    Sorry, your request cannot be fulfilled! 

    You can clear the test input and notify something.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 236 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 207 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 169

Last 30 days Overall leaderboard