New to Kendo UI for jQuery? Download free 30-day trial

Use Custom Culture Script in the NumericTextBox

Environment

Product Progress Kendo UI NumericTextBox for jQuery
Operating System Windows 10 64bit
Visual Studio version Visual Studio 2017
Preferred Language JavaScript

Description

How can I use a custom culture script in the Kendo UI for jQuery NumericTextBox?

Solution

The following example demonstrates how to extend an existing culture script, create a custom script, and use it with the NumericTextBox.

<script src="https://kendo.cdn.telerik.com/2022.2.510/js/cultures/kendo.culture.en-GB.min.js"></script>

<div id="example">
    <input id="initial" value="10" min="1"/>
    <script>
        //extend en-GB
        var customGB = $.extend(true, {}, kendo.culture(), {
            name: "custom-GB",
            numberFormat: {
              ",": " "
            }
        });

        //add a reference to the custom culture script
        kendo.cultures["custom-GB"] = customGB;
    </script>
    <script>
        kendo.culture("en-GB");

        $(document).ready(function() {
            $("#initial").kendoNumericTextBox({
              culture: "custom-GB" //use custom culture
            });
        });
    </script>
</div>

See Also

In this article