Michael,
Before I disagree with you, let me state that I completely agree with
you. It is the programmer's responsibility to take account of a
user's settings (culture) when interacting with that user. However.
I find, after writing many web apps, that like some clients request
modules they never use, some users do not set their language in the
browsers. I get users asking why their numbers look like 123.45
instead of 123,45 (I live in belgium). On my own computer these
values are not set-- Microsoft does not have a culture en-BE (english
speaking in belgium). Just to add to this problem, when converting
numbers to strings, to put in a databases for example, an additional
concern is raised: does the db expect the IV representation of the
number or the current cultural representation (and if the cultural,
then certainly not the current (dotnet) thread, but it's own thread).
We also have the additional load of clients asking (in belgium) for an
all-english application. So what culture do you set?
As with pass by value/reference, this topic is as clear as mud: it
confuses beginners and for all others it seems like a work around.
There seems to be no way to create an app without (somewhere)
double.ToString(someCulture).
Scott
Michael (michka) Kaplan said:
Actually, the normal default is to use the user's preferences. This has been
true f every version of Windows and the .NET Framework and is only
non-intuitive to developers who do not take into account the fact that users
may have a preference that is different than their own.
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
An Ony said:
Still a bit silly that it takes the OS's region settings and not
by
default
the invariant, but it works I guess :/
"Scott" <
[email protected]> schreef in bericht
I find that it makes more sense to use the InvariantCulture instead of
en-US, because the InvariantCulture won't change (it's invariant).
Ok, the US one won't change either, but you never know.
scott
message Actually, when you convert it to a string, use the ToString method
and use
the one that accepts a CultureInfo. Just pick the CultureInfo for
en-US
rather than using Dutch.
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
Oh I can't believe it, my OS is in Dutch, very annoying
and now this:
double a = 0.8;
Console.WriteLine(a);
outputs: 0,8
yes! a comma!!! argh!! that's all very neat, but in order to use
my output
with another program I need to have a dot and not a comma!!
Am I going to change them manually every time to a . or can I say
somewhere
to use a "." and not a ","? Probably changing it in the OS's
localizations,
but I'd like to leave that alone.