473,396 Members | 1,992 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.

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 7134
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*****@nowhere.com> wrote in message
news:41****************@news.btclick.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 GetSystemDefaultLCID
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 GetUserDefaultLCID 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********************@karoo.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.n et.cable.rogers.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 GetSystemDefaultLCID
: 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 GetUserDefaultLCID 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********************@karoo.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********************@twister01.bloor.is.net .cable.rogers.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.n et.cable.rogers.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 GetSystemDefaultLCID
: 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 GetUserDefaultLCID 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********************@karoo.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
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...
3
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
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...
3
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...
6
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...
1
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: ...
4
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...
4
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...
2
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...
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:
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...
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,...

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.