By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

Decimal separator

P: n/a
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.
Nov 20 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
but my program doesnt work if the separator is a comma.


Then why don't you fix your program instead of messing with the user's
settings?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 20 '05 #2

P: n/a
Thats what i meant, how can i change the program to use dots as decimal
separators instead of commas if the regional settings decimal separator is
selected as a comma.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
but my program doesnt work if the separator is a comma.


Then why don't you fix your program instead of messing with the user's
settings?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.

Nov 20 '05 #3

P: n/a
you need to study then System.Globalization - namespace. In Msdn you will
find the possibility to set your prefered Culture.
To get the current separator:

Dim DecimalSeparator As Char =
System.Globalization.CultureInfo.CurrentCulture.Nu mberFormat.NumberDecimalSe
parator

Alfred M.

"T.K Kullervo" <ta******@hotmail.com> schrieb im Newsbeitrag
news:%2****************@TK2MSFTNGP10.phx.gbl...
Thats what i meant, how can i change the program to use dots as decimal
separators instead of commas if the regional settings decimal separator is
selected as a comma.

"Mattias Sjögren" <ma********************@mvps.org> wrote in message
news:Oa**************@TK2MSFTNGP09.phx.gbl...
but my program doesnt work if the separator is a comma.


Then why don't you fix your program instead of messing with the user's
settings?

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.


Nov 20 '05 #4

P: n/a
Cor
Can you describe that better, what does not work, normaly it has to do
everything automatic
(The only strange thing I know now is that the culture settings in Net 1.1
on W'98/Me stystems not are set by culture but by keyboard settings)
Nov 20 '05 #5

P: n/a
The program is used to send values to another program, which runs on the
command prompt. The sent values are either selected by the user from
numericupdowns or straight from an excel sheet. Then the cmd-program makes
calculations based on the values sent to it.

Private Sub StreamInput(ByVal strText As String)
m_Process.StandardInput.WriteLine(strText)

m_Process.StandardInput.Flush()

End Sub

This is the code used to send the values to the console program. Ive tried
strText.replace(",","."). The Program works fine when the
regional-options-->decimal symbol is set to ".",but when it is "," it doesnt
work
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
Can you describe that better, what does not work, normaly it has to do
everything automatic
(The only strange thing I know now is that the culture settings in Net 1.1
on W'98/Me stystems not are set by culture but by keyboard settings)

Nov 20 '05 #6

P: n/a
>Thats what i meant, how can i change the program to use dots as decimal
separators instead of commas if the regional settings decimal separator is
selected as a comma.


Why don't you design your app to work correctly regardless of the
decimal separator selected instead? Ignoring the user's settings tends
to just cause confusion.

Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/
Please reply only to the newsgroup.
Nov 20 '05 #7

P: n/a
Cor
TK
Don't see the culture elements a string is just a string
Did you do
strText.replace(",",".") ' does nothing
or
strText = strText.replace(",",".")
Cor

Nov 20 '05 #8

P: n/a
strText = strText.replace(",","."). I dont know what the problem is, maeby
its with the other program. All i know is that the whole system works when
the decimal symbol is set to dot and it doesnt work when its set comma. I
put a textbox on the form and checked out the values sent. The values sent
from my program are like 3.45 not 3,45.
"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
TK
Don't see the culture elements a string is just a string
Did you do
strText.replace(",",".") ' does nothing
or
strText = strText.replace(",",".")
Cor

Nov 20 '05 #9

P: n/a
Cor
And that comes direct from the textbox without any cast?
Nov 20 '05 #10

P: n/a
There are a number of numericupdowns which values are set to
InputStrings(12) and they are run from a loop to the StreamInput. Thank you
for your interest and help but im afraid i have to bypass this problem for
now, because i have more urgent things to solve. I know it would probably
help if i put more of the code for you to read, but im afraid thats not
possible. Thanks again

"Cor" <no*@non.com> wrote in message
news:3f***********************@reader21.wxs.nl...
And that comes direct from the textbox without any cast?

Nov 20 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.