473,320 Members | 1,965 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,320 software developers and data experts.

International Number Formats

I am currently working on an application that is being
used mostly in the US but recently has been purchased by
several users outside the US, mostly in South America. The
application uses an Access 2000 database for storing the
data.

The problem I am seeing is that when numbers and currency
values are entered into the application, the regional
settings of the users machine formats the numbers to use
their local settings. For example, if you enter $1,000.00
the number is automatically transformed to $1.000,00 which
is how the Spanish language treats the number. When the
application attempts to store the number in the database,
an error occurs. The error states "Cast from string
$1.000,00 to type 'Single' is not valid".

Since I do not specifically add the punctuation or control
the format in any way in the code, I am not sure how to
approach the problem. If anyone has any ideas, I would be
very grateful for your suggestions. I would like to
resolve the problem in such a way that I do not have to
have different versions for different areas of the world.

Thanks in advance for any assistance you might be able to
provide!
Jul 21 '05 #1
1 1731
You can parse for other cultures' number formats
explicitly by specifying their culture info in a parse
method:

Console.WriteLine(Int32.Parse("1.000,00",
NumberStyles.Any, new CultureInfo("es-AR")));

Where es-AR = español Argentina (see the CultureInfo class
docs for all cultures)

There are more sophisitcated ways to accomodate cultures
in your apps, but I'm not familiar with them (try
searching for Globalization in .NET, should turn up some
resources).

Richard
-----Original Message-----
I am currently working on an application that is being
used mostly in the US but recently has been purchased by
several users outside the US, mostly in South America. The application uses an Access 2000 database for storing the
data.

The problem I am seeing is that when numbers and currency
values are entered into the application, the regional
settings of the users machine formats the numbers to use
their local settings. For example, if you enter $1,000.00
the number is automatically transformed to $1.000,00 which is how the Spanish language treats the number. When the
application attempts to store the number in the database,
an error occurs. The error states "Cast from string
$1.000,00 to type 'Single' is not valid".

Since I do not specifically add the punctuation or control the format in any way in the code, I am not sure how to
approach the problem. If anyone has any ideas, I would be
very grateful for your suggestions. I would like to
resolve the problem in such a way that I do not have to
have different versions for different areas of the world.

Thanks in advance for any assistance you might be able to
provide!
.

Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Jenta | last post by:
A World Beyond Capitalism 2005, An Annual International Multiracial Alliance Building Peace Conference Is Accepting Proposals... ...and Online Registration is now available if you plan to table...
2
by: seigo | last post by:
I use datetime condition in sql-query. For example: select something from sometable where date between '06/15/04 00:00:00' and '06/15/04 23:59:59' and result on two synchronized servers is...
0
by: MarionEll | last post by:
XML 2004 Shows International Side to XML Alexandria, Va. - Oct. XX, 2004 - IDEAlliance, a leading industry association dedicated to fostering XML and other information technology standards, today...
15
by: Steve | last post by:
Hi, I've been charged with investigating the possibilities of internationalizing our C++ libraries. std::strings are used all over the place, and unfortunately a mixture of...
0
by: MarionEll | last post by:
XML 2004 Shows International Side to XML Alexandria, Va. - Oct. XX, 2004 - IDEAlliance, a leading industry association dedicated to fostering XML and other information technology standards, today...
4
by: Vladislav Moltchanov | last post by:
I try to use MS Access application as data entry/verification tool in a multi-centre international project, where each centre uses this application for local project management and data...
1
by: Roger | last post by:
I am currently working on an application that is being used mostly in the US but recently has been purchased by several users outside the US, mostly in South America. The application uses an...
5
by: Kevin Newman | last post by:
Does anyone know of any application (AJAX or other) that will display the appropriate address for for the selected (or detected) country? If not, does anyone know where I can find a list or...
6
by: tatata9999 | last post by:
Hi all, I have this simple time management tool designed and developed. And based on a very thoughtful and kind Frenchman's input I've extended its support to international (support all time...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.