Declined
Last Updated: 09 Feb 2021 11:33 by ADMIN
n/a
Created on: 08 Feb 2021 19:55
Category: NumericTextBox
Type: Feature Request
2
Allow percentage format without multiplying by 100
Currently when you use a "p" format in the numerictextbox, the value is multiplied by 100. The numerictextbox should support the option to show the percentage symbol without modifying the input value.
1 comment
ADMIN
Martin Bechev
Posted on: 09 Feb 2021 11:33

Hello Donald,

Thank you for your feedback.

The reason why the NumericTextBox component behaves in this way is that it accepts a valid number as input.

A percentage is a dimensionless number (pure number) and it has no unit of measurement. It is a number or ratio expressed as a fraction of 100. That is why displaying 20% requires the user to enter a valid number - e.g. 0.2.

To show the value entered itself as the percentage value i.e. prevent the multiplication by 100, create a custom format string, e.g.:

<kendo-numerictextbox
      format="#.##\\%"
      [value]="value"
    ></kendo-numerictextbox>

Here is an example:

https://stackblitz.com/edit/angular-cslw6y-255hhe

For more details check this document:

https://github.com/telerik/kendo-intl/blob/master/docs/num-formatting/index.md#custom

Regards,
Martin
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.