How is the Precision of Numbers handled within the Native Component NumericTextBox input?

1 Answer 92 Views
NumericTextBox NumericTextBox wrapper
Wesley
Top achievements
Rank 1
Iron
Wesley asked on 18 May 2022, 02:03 PM | edited on 15 Jun 2022, 11:27 AM

For the NumericTextBox Wrapper Component there is the following page which allows the setting and restriction of decimals within the NumericTextBox input.

For the NumericTextBox Native Component I can only find the Formats page which doesn't tell anything about the Precision of Numbers as for the Wrapper Component.

Can I only use the format prop for this by using a custom format (generated based on different regex'es) or is the old functionality related to the decimals and restrictDecimals props also available for the Native Component?

If not, how can I dynamically set or restrict the amount of numbers and decimals within the Native Component?

 

1 Answer, 1 is accepted

Sort by
2
Accepted
Petar
Telerik team
answered on 19 May 2022, 01:45 PM

Hi Wesley,

To format the value of the Native NumericTextBox, you can use the format property of the component.

Currently, the page from the documentation that shows the options available for the format property is not working. This is why you can check the NumberFormatOptions API page from the Kendo UI for Angular documentation. The properties that can be set for the format prop are the same as those listed in the Angular documentation. 

Here is a StackBlitz example demonstrating how we can use the minimumIntegerDigits and minimumFractionDigits NumberFormat props. Based on the shared details, the property you need in your scenario should be the minimumFractionDigits. 

I hope the above details will help you achieve what you need in your application.  

Regards,
Petar
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Wesley
Top achievements
Rank 1
Iron
commented on 19 May 2022, 02:33 PM | edited

Ah okay, thanks Petar. I'm going to use the example in your StackBlitz.

My colleague Vincent also mentioned that it's smart to look at the Angular documentation because that is more complete than the current Vue documentation atm.

Petar
Telerik team
commented on 20 May 2022, 05:52 AM

Hi, Wesley. 

We are doing our best to be up to date with the Vue documentation but there are some unavailable articles like the one I sent you. However, the good thing is that the Vue and Angular suites share similar APIs in part of the functionalities they provide.  

I hope the provided example and the API page I sent you will help you achieve what you need. 

Tags
NumericTextBox NumericTextBox wrapper
Asked by
Wesley
Top achievements
Rank 1
Iron
Answers by
Petar
Telerik team
Share this question
or