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

Grid and globalization problem

7 Answers 546 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Oscar
Top achievements
Rank 1
Oscar asked on 17 Feb 2012, 01:47 PM
Hello Telerik,
I've set the kendo.culture to "de-DE" in your editing sample and when UnitPrice is for example 18,12 €(note the comma decimal separtor), it returns 1.812,00 €. When the cell enters in mode edition, the comma separator is translated to period that means thousands separator in "de" culture.
I've attached a zip with some pictures showing this issue.
Is there any workaround for this.
Kind regards,
Oscar.

7 Answers, 1 is accepted

Sort by
0
Rosen
Telerik team
answered on 17 Feb 2012, 04:47 PM
Hi Oscar,

I'm afraid that I'm unable to recreate such behavior locally using the provided information. Please take a look at this jsFiddle, maybe I'm missing something obvious.

Regards,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 17 Feb 2012, 05:09 PM
Hello Rosen,
To reproduce the issue, follow the next steps:
1) Click in any UnitPrice cell that has decimals. For example in the cell whose value is 21,35€ of the Chef Antons's Gumbo row. After click, 21.35 is shown.
2) Click in any other cell. The value changes to 2.135,00 €.
0
Rosen
Telerik team
answered on 20 Feb 2012, 08:51 AM
Hello Oscar,

Indeed, you are correct. I was able to observe the issue you have described. However, we managed to address it and this behavior should not be present with the next official release of the library. Meanwhile, I have updated your telerik points. 

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 21 Mar 2012, 02:26 PM
Hello Rosen,
I've tested your jsFiddle sample with Q1 2012 Beta. Decimal separator seems to be ok, but  it doesn't take into account the number of decimals in its format, for example {0:c3} or {0:n3}. It only considers two decimals. it returns always zero for the third decimal and the second one is rounded.
0
Rosen
Telerik team
answered on 21 Mar 2012, 03:37 PM
Hello Oscar,

The behavior you have described is caused by the fact that NumericTextBox will use the current culture decimal settings by default when parsing the input. In this case the culture decimal digits is 2, which will cause the behavior you have observed. In order to correct this, you may set the following line after setting the culture:

kendo.culture("de-DE");
 
 
kendo.culture().numberFormat.decimals = 4

All the best,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Oscar
Top achievements
Rank 1
answered on 22 Mar 2012, 10:09 AM
Hello Rosen,
But changing the kendo.culture().numberFormat.decimals will apply to all numeric columns. Isn't it?
The format of a numeric column could be {0:n0}, and another one {0:n3}. When the cell enters in edit mode, it lets the user enter more decimals than allowed by the format. I would like that if the format's column is 0 decimals, the user can't enter any decimal, regardless of kendo.culture().numberFormat.decimals. How can I accomplish this? How can I tell each column how many decimals the user can enter?
0
Rosen
Telerik team
answered on 22 Mar 2012, 01:55 PM
Hello Oscar,

As I have mentioned, the parsing logic of the NumericTextBox is using the culture settings, not the format. Therefore, in order to adjust the number of decimal digits per NumericTextBox instance, you should set its decimal option. However, this can be achieved, during grid editing, through use of column custom editor

Greetings,
Rosen
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
Grid
Asked by
Oscar
Top achievements
Rank 1
Answers by
Rosen
Telerik team
Oscar
Top achievements
Rank 1
Share this question
or