Adding a % sign to a percentage in a NumericTextBox

2 posts, 1 answers
  1. M
    M avatar
    3 posts
    Member since:
    Aug 2012

    Posted 02 Jan 2013 Link to this post

    Trying to add a % sign to a number in a Kendo NumericTextBox. You suggest escaping the % sign as such:

        format: "# \%"

    but when I give it a value of 3, it still gives me 300%!

    From your documentation:

    "%" - percentage placeholder Multiplies a number by 100 and inserts a localized percentage symbol in the result string. Note: '%' symbol is interpreted as a format specifier in the format string. If you need to prevent this, you will need to precede the '%' symbol with a backslash -'kendo.toString(12, "# \%")' -> 12 % (en-us).

  2. Answer
    Alexander Valchev
    Alexander Valchev avatar
    2877 posts

    Posted 03 Jan 2013 Link to this post


    There is a mistake in the documentation. To escape the % symbol you should use double back slash (\\).
        format: "# \\%"
    kendo.format("{0:# \\%}", 12); //12 %
    kendo.toString(12, "# \\%"); //12 %

    Here is a runnable example:

    The help article will be updated soon. As a small sign of our appreciation for bringing this to our attention I updated your Telerik points.

    Kind regards,
    Alexander Valchev
    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
Back to Top