Override the number formats in a culture
Environment
Product | Progress Telerik UI for ASP.NET MVC Grid |
Progress Telerik UI for ASP.NET MVC version | Created with the 2023.2.829 version |
Description
How can I override the numeric delimiters for Telerik UI for ASP.NET MVC 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: