开发者

databinding list of double with invariant culture

开发者 https://www.devze.com 2023-01-12 03:03 出处:网络
I happen to have a list of double in a class and databind it to a开发者_如何转开发 combobox. The problem I am experiencing is that the displayed text for double has a comma instead of the dot. Ex 2,56

I happen to have a list of double in a class and databind it to a开发者_如何转开发 combobox. The problem I am experiencing is that the displayed text for double has a comma instead of the dot. Ex 2,56 isntead of 2.56.

The combo box seems to convert my doubles to string using the application culture

I cannot just change the application culture to Invariant. Any idea how I can force doubles in my application to use the invariant culture?


doubles are just numbers. They do not have a culture.

ComboBoxes, on the other hand, do. You can set it using the ComboBox.FormatInfo property.

0

精彩评论

暂无评论...
验证码 换一张
取 消