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. 5 12430
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.
"An Ony" <no*****@somewhere.net> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl... 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.
Still a bit silly that it takes the OS's region settings and not by default
the invariant, but it works I guess :/
"Scott" <sc*****@thegapJUNKcompany.com> schreef in bericht
news:%2***************@TK2MSFTNGP12.phx.gbl... 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
"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in message news:eR*************@TK2MSFTNGP12.phx.gbl... 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.
"An Ony" <no*****@somewhere.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... 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.
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" <no*****@somewhere.net> wrote in message
news:Oi****************@TK2MSFTNGP10.phx.gbl... Still a bit silly that it takes the OS's region settings and not by
default the invariant, but it works I guess :/
"Scott" <sc*****@thegapJUNKcompany.com> schreef in bericht news:%2***************@TK2MSFTNGP12.phx.gbl... 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
"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in message news:eR*************@TK2MSFTNGP12.phx.gbl... 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.
"An Ony" <no*****@somewhere.net> wrote in message news:%2****************@TK2MSFTNGP12.phx.gbl... > 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. > >
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 [MS]" <mi*****@online.microsoft.com> wrote in
message news:Op**************@TK2MSFTNGP12.phx.gbl... 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" <no*****@somewhere.net> wrote in message news:Oi****************@TK2MSFTNGP10.phx.gbl... Still a bit silly that it takes the OS's region settings and not
by default the invariant, but it works I guess :/
"Scott" <sc*****@thegapJUNKcompany.com> schreef in bericht news:%2***************@TK2MSFTNGP12.phx.gbl... 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
"Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com>
wrote in message news:eR*************@TK2MSFTNGP12.phx.gbl... > 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. > > > "An Ony" <no*****@somewhere.net> wrote in message > news:%2****************@TK2MSFTNGP12.phx.gbl... > > 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. > > > > > >
In my apps, I often found it instructional to have a "help" dialog that
showed samples of all of the different formats that the apps uses -- that
way people always know what they are getting. That form can even include
info on how to change the settings if they want to change it.
Once I started proactively doing that, I never received complaints from
users about the settings I used. I even managed to educate a few users about
their settings! :-)
--
MichKa [MS]
This posting is provided "AS IS" with
no warranties, and confers no rights.
"Scott" <sc*****@thegapJUNKcompany.com> wrote in message
news:O2**************@TK2MSFTNGP09.phx.gbl... 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 [MS]" <mi*****@online.microsoft.com> wrote in message news:Op**************@TK2MSFTNGP12.phx.gbl... 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" <no*****@somewhere.net> wrote in message news:Oi****************@TK2MSFTNGP10.phx.gbl... Still a bit silly that it takes the OS's region settings and not by default the invariant, but it works I guess :/
"Scott" <sc*****@thegapJUNKcompany.com> schreef in bericht news:%2***************@TK2MSFTNGP12.phx.gbl... > 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 > > > "Michael (michka) Kaplan [MS]" <mi*****@online.microsoft.com> wrote in > message news:eR*************@TK2MSFTNGP12.phx.gbl... > > 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. > > > > > > "An Ony" <no*****@somewhere.net> wrote in message > > news:%2****************@TK2MSFTNGP12.phx.gbl... > > > 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. > > > > > > > > > > > >
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Ordz |
last post by:
I want to write a program that will take a decimal with up to 4 places
and convert it to 1/16 ths. I can sort of do that with:
n = 375 * 16 / 1000
Print n; "/16"
I am planning to use an input box to enter the number with no decimal
point.
But I don't know how to get a count of the digits in the denominator.
I will also round off any...
|
by: SAN CAZIANO |
last post by:
i have to do in the onkeypress or in onchange the float (real) field
validation
I try something:
function ValidaCampo(nomeCampo,TotInteri,TotDecimali)
{
DecimalPos=NomeCampo.value.Indexof(',');
Lungh=TotInteri+TotDecimali+1; //sum the ineger + decimal +
decimal separator
|
by: Tobias |
last post by:
Hi all,
is it possible to set decimal-format in any way by using a variable or
similar?
Example:
<xsl:variable name="myseparator" select="@separator"/>
<xsl:decimal-format group-separator="{$myseparator}"/>
The error I get (with xalan):
|
by: John Bowman |
last post by:
Hi,
A couple Q's , so I've come to the experts<g>.
1) I need a definitive answer to the following debate. I've got a couple
developers who disagree on the following question. We've got an XML file of
numerical data results where it could contain values such as:
<RESULT>0.12345</RESULT> when created in English, but it could contain:...
|
by: GP |
last post by:
Decimal.Parse("100,5") returns 1005 when it should throw an
InvalidFormatException. The locale is US therefore the "," is a thousand
separator. Even if the parser confused it for the decimal separator it
should return 100.5. Maybe this bug is already logged but I couldn't find it
on MSDN.
--
Best regards,
Gianluca Pivato
--
| |
by: T.K Kullervo |
last post by:
Hi, is there someway to change the regional settings--> numbers--> decimal
separator for the the program im creating. I dont want to change it
permanently but my program doesnt work if the separator is a comma.
|
by: =?Utf-8?B?UmljaA==?= |
last post by:
Is there a way to determine if a numeric value contains a decimal? how to do
this?
If IsNumeric(txt1.Text) then ... so now I know that txt1.Text is a numeric
value. How can I tell if it is a plain integer or decimal?
Thanks,
Rich
|
by: dehranph |
last post by:
I have this code that always return zero whenever i passed 1,000,00 in
a da-DK culture or en-US culture. It works with amount less that 1000
like 99,99. but always returns 0 when greater than or equal to 1000.
Decimal separator is ",". I suspect its because the decimal and
thousand separator are the same.
Thread.CurrentThread.CurrentCulture...
|
by: DustWolf |
last post by:
Hello,
I am wondering, what is the standard for including decimal numbers in
XML code? What determines what is the decimal delimiter and what can
be the grouping symbol?
I have just realized that Microsoft's parser decides that based on the
regional settings, invalidating most numbers sent in XML
internationally. Is this a bug or is it...
|
by: =?Utf-8?B?UGFvbG8=?= |
last post by:
I have a table column of SQL smallmoney type which I am updating via a form
input field defined as decimal.
If I enter, say, 51.09 via the decimal input field (representing $51.09),
this is
displayed as 5109.0000 when I view the table data.
I'm not sure why 4 decimal places are being shown, and how would I get the
table data to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
| |
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |