Angular kendo-numerictextbox does not have round property

1 Answer 100 Views
NumericTextBox
vakifbank
Top achievements
Rank 1
vakifbank asked on 23 Dec 2021, 02:46 PM | edited on 23 Dec 2021, 02:47 PM

Hey,

I am using Kendo Angular numerictextbox.

Unlike the Vue and JQuery version, Angular version does not have "round" property.

How can I prevent rounding ? Could you please add this feature to new version ?

Best Wishes.

1 Answer, 1 is accepted

Sort by
0
Svet
Telerik team
answered on 28 Dec 2021, 08:25 AM

Hi Seyhan,

Thank you for the provided feedback.

By default, the Kendo UI for Angular NumericTextBox doesn't round its value. If that is required it could be achieved by rounding manually the value on blur or valueChange event of the component.

I have also logged a new feature request asking for a round option in our public Feedback Portal. Please see it at the following link:

https://feedback.telerik.com/kendo-angular-ui/1547698-round-option

Please let me know in case I can provide any further information on this case.

Regards,
Svet
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.

vakifbank
Top achievements
Rank 1
commented on 30 Dec 2021, 11:55 AM | edited

Hey,

The component rounds by default. To prevent this, we need a round property to set it as false.

Here is some screenshot from Kendo angular numeric-textbox page.

After the typing when I click in page here is the result.

 

As you can see it from the screenshots, number is typed 33.146 but component round it. Then, the component displayed as 33.15

 

Svet
Telerik team
commented on 04 Jan 2022, 07:51 AM

Hi Seyhan,

Thank you for the provided screenshot.

The demonstrated behavior is caused due to the applied default 'n2' format to the value. It rounds the displayed text. However, the value remains unchanged. Please see the following article about the formatting options of the NumericTextBox:

https://www.telerik.com/kendo-angular-ui/components/inputs/numerictextbox/formats/

Setting the maximumFractionDigits to 10 for example won't round the displayed text for values that have up to 10 fraction digits. Here is an example:

https://stackblitz.com/edit/angular-85s2xe?file=app/app.component.ts

I hope the provided additional details help.

 

Tags
NumericTextBox
Asked by
vakifbank
Top achievements
Rank 1
Answers by
Svet
Telerik team
Share this question
or