I don't think the browser is the issue since my gridview put;s the variable
as text in a textbox (doublefield)
I'm using dutch where , (comma) is normal while as programmer i think it's
not.
Even the numpad does not have a comma so it's a useless notation imo.
But since i'm only looking for a decimal seperator and not a thousand sep.
(not used/shown) i simply need to fetch the textbox text and convert it to a
double.
I just wrote a dumb function which inspects what the resuilt is of double to
string, comma or dot and use that to replace it in the value text.
Then i convert it.
This is the next culture specific **** functionality MS invents, we have
messed for years in VB with dates right?
At least a date conversion from and to a double exists so it's
interchangable.
So far i have not found a reliable native function to convert a value text
to double.
In ordinary programming languages it was sufficient to convert a comma to
dot and use VAL(). (always good)
I'm using c# where val() is not around, the math object shows no similar
function.
<ne**********@gmail.comschreef in bericht
news:11**********************@m79g2000cwm.googlegr oups.com...
is this 1.1 or 2.0?
what language is your browser set to?
Firefox: Menu bar - tools - options - advanced tab - languages - edit
languages - what is the top value in the list?
IE: menu bar - tools - internet options - languages - what is the top
value in the list?
asp.net 2.0 has auto globablization so it will set the culture of the
current thread to whatever your browser's first choice is. 1.1 you have
to do this manually
if you set the current thread culture to Canadian French (where comma
is the placeholder)
System.Threading.Thread.CurrentThread.CurrentCultu re = new
System.Globalization.CultureInfo("fr-ca");
1,1 will be converted to 1,1
if you set the current thread's culture to Canadian English (where dot
is the placeholder)
System.Threading.Thread.CurrentThread.CurrentCultu re = new
System.Globalization.CultureInfo("en-ca");
1,1 will be converted to 11
Edwin Knoppert wrote:
>In my code i use the text from a textbox and convert it to a double
value.
I was using Convert.ToDouble() but i'm used to convert comma to dot.
This way i can assure the text is correct.
However it seems this convert is determined by the local settings and
comma
is indeed used as decimal separator.
Is there another way to convert a dotted value to a double variable?
Like 1234.5 and not 1234,5
Also, how to determine (and not knowing it) the decimals seperator?
convert to string?