Hi,
I have a Kendo NumericTextBox which displays the percentage value. I need to display "10" and not "10.00" if the input is "10". Below is my code and i used Format(P0). but when user tries to input the value it accepts in the format like 0.01 for 1%.
@(Html.Kendo().NumericTextBox<int>()
.Name("FlexUp")
.Format("#")
.Min(0)
.Max(100)
.Step(1)
.Decimals(0)
Thanks for the help in advance.
I have a Kendo NumericTextBox which displays the percentage value. I need to display "10" and not "10.00" if the input is "10". Below is my code and i used Format(P0). but when user tries to input the value it accepts in the format like 0.01 for 1%.
@(Html.Kendo().NumericTextBox<int>()
.Name("FlexUp")
.Format("#")
.Min(0)
.Max(100)
.Step(1)
.Decimals(0)
Thanks for the help in advance.
4 Answers, 1 is accepted
0
Hello Sajid,
The behaviour which you described is expected - if the format is set to "p" the entered number will be multiplied by 100 (docs).
To display "10 %" when the user input is "10", please use the following configuration:
Regards,
Alexander Valchev
Telerik
The behaviour which you described is expected - if the format is set to "p" the entered number will be multiplied by 100 (docs).
To display "10 %" when the user input is "10", please use the following configuration:
@(Html.Kendo().NumericTextBox<int>()
.Name(
"FlexUp"
)
.Format(
"# \\%"
)
.Min(0)
.Max(100)
.Step(1)
.Decimals(0)
Regards,
Alexander Valchev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Claudie
Top achievements
Rank 1
answered on 10 Dec 2014, 08:01 AM
Hello Alexander,
I try this and it works when my NumericTextBox is on editing mode "3". But for display the value, i still show the comma "3.00".
I'd like to remove the decimal points in the value all the time.
Here, the code i try :
@(Html.Kendo().NumericTextBox()
.Name("NombreMoisPeriode")
.Min(0)
.Decimals(0)
.Format("# \\"))
or
.Format("#"))
or
.Format("c"))
witout any success
Thanks for the help in advance.
I try this and it works when my NumericTextBox is on editing mode "3". But for display the value, i still show the comma "3.00".
I'd like to remove the decimal points in the value all the time.
Here, the code i try :
@(Html.Kendo().NumericTextBox()
.Name("NombreMoisPeriode")
.Min(0)
.Decimals(0)
.Format("# \\"))
or
.Format("#"))
or
.Format("c"))
witout any success
Thanks for the help in advance.
0
Hello Claudie,
The correct setup is the one you've posted in your first post. I prepared a simple demo that shows the correct behavior of the widget. I also took a screencast of its work.
Let me know if I am missing something.
Regards,
Georgi Krustev
Telerik
The correct setup is the one you've posted in your first post. I prepared a simple demo that shows the correct behavior of the widget. I also took a screencast of its work.
Let me know if I am missing something.
Regards,
Georgi Krustev
Telerik
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0

Claudie
Top achievements
Rank 1
answered on 12 Dec 2014, 08:52 AM
Thank you Georgi,
It works fine.
Regards
Claudie
It works fine.
Regards
Claudie