Convert.ToDouble problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

does anybody know how to change the global IFormatProvider of my project so
everycall to Convert.ToDouble on it uses this format provider instead of the
one the one on the computer's regional configuration
 
Hi Irepan,

Convert.ToDouble uses the NumberFormatInfo of the CurrentCulture. If you change this CultureInfo you won't have to specify a IFormatProvider for eavh Convert.
 
Irepan,
does anybody know how to change the global IFormatProvider of my project
so
everycall to Convert.ToDouble on it uses this format provider instead of
the
one the one on the computer's regional configuration

Can you tell us to learn, why you want to do this?

Cor
 
sure i can, as a matter of fact i find an easy solution for this using
Thread.CurrentThread.CurrentCulture = new CultureInfo(blabla) but i need it
for PDA and CurrentCulture doesn't exists on CurrentThread's properties for
Compact framework, but anyway, the problem that i have is that when i
programmed my PDA application i used Convert.ToDouble(aString) to convert the
strings i get from the GPS to know a location so usually if i have a string
"134.523453" my double value will be 134.523453 that worked fine and i have
this kind of conversion all over my application's source, the problem is when
i use a PDA with a different Region information for instance spanish
(international) which have the decimal point set to a colon "," and the
separators as points "." then at those PDA's the function will get me a value
of 134523453 instead of the 134.523453 that i need.
 
Back
Top