Possible Duplicate:
How to convert culture specific double using TypeConverter?
I am getting an exception while trying to parse an "1.000.000" string to Double
by using TypeConverter
.
I looked at the System.Globalization.NumberFormatInfo
at the moment of exception and it looks like this:
{System.Globalization.NumberFormatInfo}
CurrencyDecimalDigits: 2
CurrencyDecimalSeparator: ","
CurrencyGroupSeparator: "."
CurrencyGroupSizes: {int[1]}
CurrencyNegativePattern: 8
CurrencyPositivePattern: 3
CurrencySymbol: "TL"
DigitSubstitution: None
IsReadOnly: false
NaNSymbol: "NaN"
NativeDigits: {string[10]}
NegativeInfinitySymbol: "-Infinity"
NegativeSign: "-"
NumberDecimalDigits: 2
NumberDecimalSeparator: ","
NumberGroupSeparator: "."
NumberGroupSizes: {int[1]}
NumberNegativePattern: 1
PercentDecimalDigits: 2
PercentDecimalSeparator: ","
PercentGroupSeparator: "."
PercentGroupSizes: {int[1]}
PercentNegativePattern: 2
PercentPositivePattern: 2
PercentSymbol: "%"
PerMilleSymbol: "‰"
PositiveInfinitySymbol: "Infinity"
PositiveSign: "+"
Everyting seems fine to parse "1.000.000" but it says "1.000.000" is not a valid value for Double
. What is the problem?
I tried to override Thread.CurrentThread.CurrentCulture
but it did not work either.
EDITED :::::::::
This seems to solve my problem as well. TypeConverter actually works without ThousandSeperator. I added one and it started to work.
possible duplicate of How to convert culture specific double using TypeConverter? – Rasmus Faber How to convert culture specific double using TypeConverter?