Skip to content

Latest commit

 

History

History
76 lines (66 loc) · 2.14 KB

culture-override-settings.md

File metadata and controls

76 lines (66 loc) · 2.14 KB
title page_title description slug tags res_type
Override the number formats in a culture
Substitute the culture delimiters in the numbers.
Learn how to change Telerik UI for {{ site.framework }} culture number delimiters.
culture-override-settings
culture, numeric, numbers, override, numberFormat, currency, percent
kb

Environment

Product Progress {{ site.product }} Grid
Progress {{ site.product }} version Created with the 2023.2.829 version

Description

How can I override the numeric delimiters for {{ site.product }} 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 {{ site.framework }} Culture Resources

  • [Globalization Overview]({%slug overview_globalization_core%})
  • [Right-to-Left Languages]({%slug overview_rtlsupport_core%})
  • [Localization]({%slug overview_localization_core%})

See Also

  • [Telerik UI for {{ site.framework }} Breaking Changes]({%slug breakingchanges_2023%})
  • [Telerik UI for {{ site.framework }} Knowledge Base](https://docs.telerik.com/{{ site.platform }}/knowledge-base)