MVVM

by lhoeppner

HTML

<script src="http://cdn.kendostatic.com/2013.3.1119/js/kendo.all.min.js"></script>
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.common.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.default.min.css">
<link rel="stylesheet" href="http://cdn.kendostatic.com/2013.3.1119/styles/kendo.mobile.all.min.css">
<input type='text' id="num" />

JavaScript

var numeric = $("#num").kendoNumericTextBox({
    spinners: false,
    culture: "en-US",
    decimals: 4,
    step: 0.01,
    format: "n3"
}).data("kendoNumericTextBox");

$(numeric.element).on("input", function (e) {
    var val = numeric.element.val();
    var parts;
    if (val.indexOf(".") !== -1) {
        parts = val.split(".");
        if (parts[1].length > 4) {
            numeric.element.val(val.substr(0, val.length - 1));
        }
    }
});