How to remove the auto formating on numericTextBox (Asp.net core) ?

1 Answer 76 Views
NumericTextBox
Florian
Top achievements
Rank 1
Florian asked on 25 Nov 2021, 03:19 PM

How to display the real value without formating.

Default formating is N2 :

Value : 10.567

Display: 10.56 or 10.57 with round

 

Change formating to N8 :

Value : 10.5678

Display: 10.56780000

 

I would like to display 10.567 or 10.5678 without 0, as in edition.

 

Thx.

1 Answer, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 26 Nov 2021, 03:13 PM

Hi Florian,

Thank you for the provided information.

You can achieve the desired result by configuring the number precision through the .Decimals() configuration option. In general, if not set the precision defined by the current culture will be used instead. For example:

@(Html.Kendo().NumericTextBox<double>()
            //additional configuration...
            .Value(15.5678)
            .Format("n4")
            .Decimals(4)
)

I have made a Telerik REPL illustrating the mentioned above with both custom and default number formatting.

I hope this helps.

Regards,
Alexander
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/.

Tags
NumericTextBox
Asked by
Florian
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Share this question
or