473,395 Members | 1,474 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,395 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 1733
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.