Search code examples
kendo-uikendonumerictextbox

KendoUI NumericTextBox doesn't hold values right


Using a Kendo UI numeric text box, I am having an issue with getting it to retain the number given between clicks. Here is my example...

<input id="${Statistic.Name}-size"
    type="number"
    value="30"
    class="dark"
    style="width: 100px; float: left;"
    data-bind="value: Measurement"
    data-role="numerictextbox"
    data-decimals="5"
    data-step="0.001" />

The numeric text box is formatted exactly how I want, but if I type in "0.005", then I click somewhere else, the text box changes to "0.01".

However if I click on it again, it changes back to 0.005, and then back to 0.01 when I click elsewhere.


Solution

  • You need to set the format property to an appropriate format string which can display more than two decimal digits.

    Something like:

    data-format="0.#####"
    

    Demo JSFiddle.