473,804 Members | 2,096 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Detecting Currency Settings?

H
Hi All,

Is it possible to detect a users regional settings, in particular -
Currency?

Thanks!

Hellen.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004
Jul 17 '05 #1
6 7154
On Fri, 13 Aug 2004 09:43:34 +0100, "H" <H@opijpoijpoij .com> wrote:
Hi All,

Is it possible to detect a users regional settings, in particular -
Currency?


The easiest way is
N# = Val( 1000.01 )

Then
S$ = CStr( N# )
Jul 17 '05 #2
> Is it possible to detect a users regional settings, in particular -
Currency?


Regional Locale Currency Settings
=============== =============== =
http://vbnet.mvps.org/code/locale/localecurrency.htm

Regional Locale Numeric Settings
=============== =============== =
http://vbnet.mvps.org/code/locale/localenumerics.htm

Regional Locale Date Settings
=============== ==============
http://vbnet.mvps.org/code/locale/localedates.htm

Regional Locale Time Settings
=============== ==============
http://vbnet.mvps.org/code/locale/localeenumtime.htm

Rick - MVP
Jul 17 '05 #3
H

"J French" <er*****@nowher e.com> wrote in message
news:41******** ********@news.b tclick.com...
On Fri, 13 Aug 2004 09:43:34 +0100, "H" <H@opijpoijpoij .com> wrote:
Hi All,

Is it possible to detect a users regional settings, in particular -
Currency?


The easiest way is
N# = Val( 1000.01 )

Then
S$ = CStr( N# )


Thanks! Excellent solution and I feel stupid now..

Rick, I found that webpage, but the code dosent work, well on my XP Sp2
system anyway. Im set to UK english on everything and it reports US dollars
etc.. Thanks anyway for your reply.

Hellen.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004
Jul 17 '05 #4
Hi H ...

The currency code at http://vbnet.mvps.org/code/locale/localecurrency.htm
does work ... I understand you can't get it working on your XP SP2 box?

I have the same setup as you -- I just installed XP SP2 last night. When I
saw Rick's referral to this link earlier tonight I wanted to make sure it
worked as well, and actually created the demo from the site. Other than it
having a duplicate Option Explicit statement the code there does work on all
VB5 and VB6 systems - so the OS version or SP is not a factor.

Note that Windows has two different settings for Regional preferences --
those for the system, based on the locale installed and Windows version, and
those for the user. This is what lets you install a US version of Windows
but set the system to have British monetary and other settings. Or install
German Windows and customize for Dutchman. (I have the US version, but am
set up as Canadian - we have a lot more vowels <vbg>).

Because of these different locale settings there are two LCIDs for the
system. The page you downloaded used an API called GetSystemDefaul tLCID
which not surprisingly retrieves the system setting I mentioned. If you have
a US Windows and did not customize this, US data would be returned. The
sister API is GetUserDefaultL CID which retrieves the settings for the
current user, and which is now shown on the new page I just uploaded
tonight. (There's actually a third Locale - the locale the current thread is
executing in retrieved using GetThreadLocale . That API is defined on that
page but not used in the demo.)

See if you get the expected results with the new code, and post back here
with the results

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"H" <H@opijpoijpoij .com> wrote in message
news:CD******** ************@ka roo.co.uk...
: Hi All,
:
: Is it possible to detect a users regional settings, in particular -
: Currency?
:
: Thanks!
:
: Hellen.
:
:
: ---
: Outgoing mail is certified Virus Free.
: Checked by AVG anti-virus system (http://www.grisoft.com).
: Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004
:
:

Jul 17 '05 #5
.... BTW, this same change applies to those other pages Rick referred you to
but which I haven't had the opportunity to change as yet. Just switch the
API used to retrieve the LCID.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Randy Birch" <rg************ @mvps.org> wrote in message
news:rK******** **************@ twister01.bloor .is.net.cable.r ogers.com...
: Hi H ...
:
: The currency code at http://vbnet.mvps.org/code/locale/localecurrency.htm
: does work ... I understand you can't get it working on your XP SP2 box?
:
: I have the same setup as you -- I just installed XP SP2 last night. When
I
: saw Rick's referral to this link earlier tonight I wanted to make sure it
: worked as well, and actually created the demo from the site. Other than it
: having a duplicate Option Explicit statement the code there does work on
all
: VB5 and VB6 systems - so the OS version or SP is not a factor.
:
: Note that Windows has two different settings for Regional preferences --
: those for the system, based on the locale installed and Windows version,
and
: those for the user. This is what lets you install a US version of Windows
: but set the system to have British monetary and other settings. Or install
: German Windows and customize for Dutchman. (I have the US version, but am
: set up as Canadian - we have a lot more vowels <vbg>).
:
: Because of these different locale settings there are two LCIDs for the
: system. The page you downloaded used an API called GetSystemDefaul tLCID
: which not surprisingly retrieves the system setting I mentioned. If you
have
: a US Windows and did not customize this, US data would be returned. The
: sister API is GetUserDefaultL CID which retrieves the settings for the
: current user, and which is now shown on the new page I just uploaded
: tonight. (There's actually a third Locale - the locale the current thread
is
: executing in retrieved using GetThreadLocale . That API is defined on that
: page but not used in the demo.)
:
: See if you get the expected results with the new code, and post back here
: with the results
:
: --
:
: Randy Birch
: MVP Visual Basic
: http://vbnet.mvps.org/
: Please respond only to the newsgroups so all can benefit.
:
:
: "H" <H@opijpoijpoij .com> wrote in message
: news:CD******** ************@ka roo.co.uk...
:: Hi All,
::
:: Is it possible to detect a users regional settings, in particular -
:: Currency?
::
:: Thanks!
::
:: Hellen.
::
::
:: ---
:: Outgoing mail is certified Virus Free.
:: Checked by AVG anti-virus system (http://www.grisoft.com).
:: Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004
::
::
:

Jul 17 '05 #6
H
Thanks Randy,

It does indeed work very nicely with the new code.

Ta!

Hellen.

"Randy Birch" <rg************ @mvps.org> wrote in message
news:iN******** ************@tw ister01.bloor.i s.net.cable.rog ers.com...
... BTW, this same change applies to those other pages Rick referred you
to
but which I haven't had the opportunity to change as yet. Just switch the
API used to retrieve the LCID.

--

Randy Birch
MVP Visual Basic
http://vbnet.mvps.org/
Please respond only to the newsgroups so all can benefit.
"Randy Birch" <rg************ @mvps.org> wrote in message
news:rK******** **************@ twister01.bloor .is.net.cable.r ogers.com...
: Hi H ...
:
: The currency code at
http://vbnet.mvps.org/code/locale/localecurrency.htm
: does work ... I understand you can't get it working on your XP SP2 box?
:
: I have the same setup as you -- I just installed XP SP2 last night.
When
I
: saw Rick's referral to this link earlier tonight I wanted to make sure
it
: worked as well, and actually created the demo from the site. Other than
it
: having a duplicate Option Explicit statement the code there does work on
all
: VB5 and VB6 systems - so the OS version or SP is not a factor.
:
: Note that Windows has two different settings for Regional preferences --
: those for the system, based on the locale installed and Windows version,
and
: those for the user. This is what lets you install a US version of
Windows
: but set the system to have British monetary and other settings. Or
install
: German Windows and customize for Dutchman. (I have the US version, but
am
: set up as Canadian - we have a lot more vowels <vbg>).
:
: Because of these different locale settings there are two LCIDs for the
: system. The page you downloaded used an API called GetSystemDefaul tLCID
: which not surprisingly retrieves the system setting I mentioned. If you
have
: a US Windows and did not customize this, US data would be returned. The
: sister API is GetUserDefaultL CID which retrieves the settings for the
: current user, and which is now shown on the new page I just uploaded
: tonight. (There's actually a third Locale - the locale the current
thread
is
: executing in retrieved using GetThreadLocale . That API is defined on
that
: page but not used in the demo.)
:
: See if you get the expected results with the new code, and post back
here
: with the results
:
: --
:
: Randy Birch
: MVP Visual Basic
: http://vbnet.mvps.org/
: Please respond only to the newsgroups so all can benefit.
:
:
: "H" <H@opijpoijpoij .com> wrote in message
: news:CD******** ************@ka roo.co.uk...
:: Hi All,
::
:: Is it possible to detect a users regional settings, in particular -
:: Currency?
::
:: Thanks!
::
:: Hellen.
::
::
:: ---
:: Outgoing mail is certified Virus Free.
:: Checked by AVG anti-virus system (http://www.grisoft.com).
:: Version: 6.0.735 / Virus Database: 489 - Release Date: 06/08/2004
::
::
:

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.737 / Virus Database: 491 - Release Date: 11/08/2004
Jul 17 '05 #7

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

Similar topics

2
3638
by: Vlad | last post by:
Hi, I am trying to display a currency value formated according to the current culture in ASP.NET: decimal x = 125345.54M; string currencyString = String.Format("{0:c}",x); what gets retured is 125,345.54 without the currency symbol of $ I checked and re-checked my regional settings and tried it on other PCs without success...
3
13558
by: Melissa | last post by:
I have several fields in my database specified as Currency data type. Is there a way globally to set these fields not to display the dollar sign? Thanks! Melissa
2
4562
by: Bob Dydd | last post by:
Hi Everbody Question Changing the regional settings ie. from UK to US AUS etc, Access retains the original currency format that the application was created in. So if an mdb that is written on a computer with Regional Settings Currency Format set to UK £'s , when that mdb is open on a machine
3
2042
by: Dave Stone | last post by:
This question appeared years ago in the context of Acc2K and SQL Server 7, but no replies were posted. HOWEVER!! It still seems to be a problem with Acc XP and SQL Server 2000. Surely someone has a fix 6 years down the line... I used the Upsizing Wizard to build a SQL database from an Access back-end and link it to the Access f/e. All the data appear to have gone across OK as viewed from Enterprise Manager, but from the front-end all...
6
2390
by: Richard Steele (Basemap) | last post by:
does anyone know how to produce the following custom string for formatting currency inc the appropriate currency symbol for the country i could use String.Format("{0:C}", 2000) which will return £2000.00 but i do not want to show the decimal place i.e £2000 thanks
1
1231
by: Shapper | last post by:
Hello, I have an Access database table where the field is of currency type. What do I need to do in my datagrid so that the price column always display the price number in such a format: 10,032.45 €
4
2032
by: Mitchell Vincent | last post by:
How is everyone formatting currency with VB.NET? Before I was calling the API function for it, which took the currency symbol from the Windows settings. I've found this to be limited when working with European countries where business in conducted in several different currencies. Are you guys just storing a currency symbol and formatting the number accordingly? What about the comma and decimal switch that some locales use? I hope .NET...
4
1992
by: david.w.anderson1 | last post by:
This is a homework assignment. The code works but does not "catch" all the improper input. The requirement is to be able to accept one input currency, which is error checked as a valid entry, and then display its equivalency in US dollars. The program does detect when a letter is entered as the 1st digit. I need the program to detect when a number-letter combination is entered (example 1a) and show the error.
2
3891
by: Ian | last post by:
I have an Access 2000 database written in the UK, this database has many fields set to Currency, I now want to move this database over to a user in the USA but my Currency fields still show the UK £ sign. If I look at these currency fields on my UK PC with it set to regional UK (not USA) then the fields format settings just say Currency, if I then add the USA region to my PC and look at the format again it says: £#,##0.00;-£#,##0.00 I...
0
9595
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10352
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10354
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10097
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9175
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6867
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.