This is a migrated thread and some comments may be shown as answers.

Number column no format incorrect display on globalization

1 Answer 78 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Dan asked on 20 Dec 2019, 08:11 AM

I have a grid with 2 numeric columns. One of the column has to have a maximum of 5 decimals while the other should display all the decimals it has. The configuration is like this:

columns.Bound(m => m.Numeric1).Format("{0:#.#####}");
columns.Bound(m => m.Numeric2);

However when I tried to view the values in the culture "de-DE" for example for the first column it uses the correct decimal separator "," but for the second column it still display the decimal separator ".".

Is the format of numeric values mandatory when using i18n ? What is the format for numeric with all the decimals?

1 Answer, 1 is accepted

Sort by
0
Tsvetomir
Telerik team
answered on 24 Dec 2019, 01:43 PM

Hi Dan,

Thank you for the provided explanation of the scenario you are facing. 

In general, both the comma and the dot are valid symbols in the German culture. Since the data that comes from the server would have the dot separator, it is interpreted as a valid symbol and is used as-is. What I can recommend is that you explicitly set the format to be number. Here is an example:

                    columns.Bound(p => p.Freight).Format("{0:#.#####}");
                    columns.Bound(p => p.OrderID).Format("{0:n}");

Also, it is important to point out that there is no built-in rule that could be used for rendering all of the decimals after the separator. Therefore, you would have to implement the Format with a sufficient number of "#" symbols.

Give the suggestion a try and let me know in case 

 

Regards,
Tsvetomir
Progress Telerik

Get quickly onboarded and successful with Telerik UI for ASP.NET Core with the dedicated Virtual Classroom technical training, available to all active customers.
Tags
Grid
Asked by
Dan
Top achievements
Rank 1
Iron
Iron
Veteran
Answers by
Tsvetomir
Telerik team
Share this question
or