New to Telerik UI for ASP.NET Core? Download free 30-day trial

Override the number formats in a culture

Environment

Product Progress Telerik UI for ASP.NET Core Grid
Progress Telerik UI for ASP.NET Core version Created with the 2023.2.829 version

Description

How can I override the numeric delimiters for Telerik UI for ASP.NET Core culture?

Solution

To achieve the desired scenario add a script which extends the numeric options for the culture:

<script>
        var customUS = $.extend(true, {}, kendo.culture(), {
            name: "custom-US",
            numberFormat: {
              ",": " ",
              ".": "^",
              currency: {
                ",": " ",
                ".": "^",
              },
              percent: {
                ",": " ",
                ".": "^",
              }
            }
        });
      kendo.cultures["custom-US"] = customUS;
      kendo.culture("custom-US");
</script>
@(Html.Kendo().Grid<Kendo.Mvc.Examples.Models.ProductViewModel>()
    .Name("Grid")
    .Columns(columns =>
    {
            columns.Bound(p => p.UnitPrice).Title("Unit Price");
    })
    .DataSource(dataSource => dataSource
        .Ajax()
        .Read("Products_Read", "Grid")
    )
)

For a runnable example based on the code above, refer to the:

More ASP.NET Core Culture Resources

See Also

In this article