Do not show decimals when no decimals are wanted

6 posts, 0 answers
  1. Jacob
    Jacob avatar
    3 posts
    Member since:
    Oct 2011

    Posted 12 Dec 2011 Link to this post

    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
  2. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3706 posts

    Posted 13 Dec 2011 Link to this post

    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!
  3. Kendo UI is VS 2017 Ready
  4. TazDeveloper
    TazDeveloper avatar
    18 posts
    Member since:
    Feb 2010

    Posted 20 Dec 2011 Link to this post

    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!
  5. Lerovi
    Lerovi avatar
    9 posts
    Member since:
    Jan 2012

    Posted 27 Mar 2012 Link to this post

    how I can dynamically change the decimals? 
  6. Daniel
    Daniel avatar
    10 posts
    Member since:
    Jun 2011

    Posted 13 Apr 2012 Link to this post

    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}"},
  7. Masaab
    Masaab avatar
    15 posts
    Member since:
    Nov 2013

    Posted 26 Nov 2014 in reply to Georgi Krustev Link to this post

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

    @(Html.Kendo().NumericTextBoxFor(m => m.MaximumFileCount)
                                                                .Min(0)
                                                                .Max(100)
                                                                .Decimals(0)
                                                                .Format("#"))
Back to Top
Kendo UI is VS 2017 Ready