473,396 Members | 2,036 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

APPS:C# convert double to string in different regional language give different output

6
Hi Ladies and Gentlements,

I have a variable with the type of double. Let said that it is 0.003.
Expand|Select|Wrap|Line Numbers
  1. double dblValue = 0.003
  2.  
Now, when I want to convert it to string with the local regional language set to US English .
The output value is 0.003

This is correct and fine

However, when I convert the double to string with the local regional language set to France.
The output value is 0,003

The point has became comma and this is boggling me.

The questions here are, why the conversion in France and US English give the different result? And how can we solve the problem so that the conversion from double to string can behave correctly in different regional languages?

Thanks and have a nice day.
Feb 22 '08 #1
1 2452
Plater
7,872 Expert 4TB
It's the same result. France uses the , (comma) as it's seperator not the . (period)
That would be the point of usuing regional settings, so they would understand the output.
If you REALLY need it to ALWAYS use the english version, use one of the .ToString() overrides that allows to specify the region and pick the english one
Feb 22 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Marty | last post by:
Hi, If I don't know that my (or any) windows 2k regional setting for the decimal symbol is the dot (".") and I want to do this: 1- Dim dblOutput As Double 2- Dim strInput As...
4
by: Irepan | last post by:
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...
4
by: Matt | last post by:
Hi there, I'm having a weird situation when converting strings to double. Normally, the following code would work right? double MyDouble = double.Parse("20.50"); // Error at runtime Well,...
7
by: Jim Bancroft | last post by:
Hi everyone, A basic one here, I think. I haven't found the pattern yet, but sometimes when I cast a variable to another type using the "C" style cast operator the compiler refuses to play...
2
by: Franck | last post by:
Hi, 'm gettin mad about date conversion. Here is the point. Got and add-in for Excel which call functions from a web service (on a remote server) The remote server has regional settings...
17
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge...
10
by: Nikolay Petrov | last post by:
How can I convert DOS cyrillic text to Unicode
43
by: Steven T. Hatton | last post by:
http://public.research.att.com/~bs/bs_faq2.html#int-to-string Is there no C library function that will take an int and convert it to its ascii representation? The example Bjarne shows in his faq...
19
by: VK | last post by:
http://groups.google.com/group/comp.lang.javascript/browse_frm/thread/ b495b4898808fde0> is more than one month old - this may pose problem for posting over some news servers. This is why I'm...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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...
0
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...
0
tracyyun
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...
0
agi2029
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,...
0
isladogs
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.