Search code examples
kendo-uikendonumerictextbox

Adding a % sign to a percentage in Kendo NumericTextBox


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

$("#numeric").kendoNumericTextBox({
    format: "# \%"
});

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

From the Kendo 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).


Solution

  • Did you see this forum thread? It looks like you need to escape it with two slashes...

    http://jsbin.com/aruqeh/1/