Announcements
Hi,
I'm creating an application that only allows .5 for the decimal. Just wondering if the Round function will allow it.
So for e.g. user can only input whole number or 1.5, 0.5, 2, 2.5, 3, 3.5, 4.5
Thank you.
Best Regards,
Jacq
If you use following, then you will get output in decimal to nearest 0.5
1.75 to 2.24 will give 2.0
2.25 to 2.74 will give 2.5
Is there a way that round it up while the value in the input text change? Thank you.
On the OnChange property of the Input control, create a variable that will hold your rounded value, and then in the Default property of the Input control use that variable.
Once your user types the value and come out of the TextInput control, the OnChange will kick-in and set the value to be in rounded format as you want.
If you want to always RoundUp, then instead of using Round (in my screenshot) use RoundUp instead.
--
If this post helps, then please Accept it as the solution to help the other members find it more quickly.
If my responses help you in getting your desired solution or clearing your concepts or helping you troubleshoot then please give Thumbs-up.
Hi @Anonymous,
Based on the issue that you mentioned, do you want to make the input either an integer or a decimal of 0.5?
I have a simple test for you, please take a try.
Set the OnChange property of the text input control as below:
If( !IsMatch( TextInput1.Text, "^([1-9]\d*|0)(\.5)?" ), Notify( "Either an integer or a decimal of 0.5 is allowed!", NotificationType.Error ), Notify( "Input correctly!", NotificationType.Success ) )
Need to enforce nearest to .5 for textbox
This helped a lot!!! Thank you so much
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.
Congratulations to our 2026 Super Users!
Congratulations to our 2025 community superstars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
11manish 505
WarrenBelz 502 Most Valuable Professional
Haque 324