Do not show decimals when no decimals are wanted

1 Answer 5588 Views
NumericTextBox
Jacob
Top achievements
Rank 1
Jacob asked on 12 Dec 2011, 02:53 PM
Hello,

I do not want to show decimals. But by default my numerictextbox always shows decimals, when not active! How can i remove those decimals? I just want to see my value without any decimals.

Kind regards,
Jacob
Georgi Krustev
Telerik team
commented on 13 Dec 2011, 01:17 PM

Hi Jacob,

 Check this forum thread.

Kind regards,
Georgi Krustev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!

1 Answer, 1 is accepted

Sort by
1
TazDeveloper
Top achievements
Rank 1
answered on 20 Dec 2011, 01:00 PM
The other forum thread identified by Georgi talks about percentages.  I don't know if this is the correct way to do it, but to get an integer number in the box I used the following:

$("#MYBOX").kendoNumericTextBox({
            format: "#",
            decimals: 0
});

I had first tried the decimals: 0 without a format and it did not work.

Cheers!
Lerovi
Top achievements
Rank 1
commented on 27 Mar 2012, 05:32 PM

how I can dynamically change the decimals? 
Daniel
Top achievements
Rank 1
commented on 13 Apr 2012, 10:44 PM

Just in case anybody still needs some fix to the decimal issue, here is what worked (as suggested by Telerik consultant) for  me.

In the model schema definition...
        Hours: { type: "number" },
        Minutes: { type: "number" },


 And in the columns definition...
        {field: "Hours", title: "Hours", width: "50px", format: "{0:n0}"},
        {field: "Minutes", title: "Minutes", width: "50px", format: "{0:n0}"},
Masaab
Top achievements
Rank 1
commented on 27 Nov 2014, 05:34 AM

  you can use the below code.
Set Format to .Format("#")

@(Html.Kendo().NumericTextBoxFor(m => m.MaximumFileCount)
                                                            .Min(0)
                                                            .Max(100)
                                                            .Decimals(0)
                                                            .Format("#"))
Joseph
Top achievements
Rank 1
commented on 13 Jun 2017, 03:44 PM

Thanks, This worked for me.
Joe
Top achievements
Rank 2
commented on 29 Dec 2018, 08:12 PM

Hello -- thank you this worked for me also (.Format("#")

Could somebody show me where this is at in the documentation?

I wasted almost an hour trying to find this in the online documentation.

I am using asp.net core -- but looked pretty much everywhere it felt.

Viktor Tachev
Telerik team
commented on 31 Dec 2018, 12:26 PM

Hello,

The article below described the different options that can be applied to show numeric values in a specific format:



Regards,
Viktor Tachev
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
NumericTextBox
Asked by
Jacob
Top achievements
Rank 1
Answers by
TazDeveloper
Top achievements
Rank 1
Share this question
or