Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

European Regional Settings

Status
Not open for further replies.

gcarolan

Programmer
Jun 18, 2002
36
IE
Hello,

My project deals with calculations. It can accomodate commas and decimal points ie 1,000.00. However When used in an area with a different European Regional Settings ie where it is now 1.000,00 it causes problems. There are alot of calculations does anyone know of a way of getting the project to recognise both.

any help would be appreciated

Regards
gcarolan
 
Hard coded literal numbers in US format. With all other numbers they get assigned to Number variables, and you work with/calculate using the variables.
This assumes that the númber settings in the Control Panel|Country Settings is set to the same format as the user entered format, meaning, the user has to enter a number in the same format as the Local that the OS is set as.
 
Thanks for your reply, however I´m still a bit lost. How do I go about doing this.
 
Text1.Text and Text2.Text hold numeric input from the user, which is entered using the same decimal and thousands seperators as set in the country settings:
User entered:
Text1.Text = "1,2345"
Text2.Text = "1,1234"
(User input using comma decimal seperator - Non-US format.
Country settings currency set to a comma as the decimal seperator)

Dim curValue1 As Currency
Dim curValue2 As Currency
Dim curResults As Currency

curValue1 = CCur(Text1.Text)
curValue2 = CCur(Text2.Text)

curResults = curValue1 + curValue2

Text3.Text = CStr(curResults)

'OR:

curValue1 = 1.2345@ 'Hard coded currency in US Format
curValue2 = CCur(Text2.Text)

curResults = curValue1 + curValue2
Text3.Text = CStr(curResults)

Output will be in the same currency format as in the country settings

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top