Go Back   Forum Care Forums > Development Reference Area > Visual Basic

Reply
 
LinkBack Thread Tools Display Modes
Detecting Currency Settings?
Old
  (#1)
H
Guest
 
Posts: n/a
Default Detecting Currency Settings? - 06-04-2007, 09:45 AM

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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Re: Detecting Currency Settings?
Old
  (#2)
J French
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM

On Fri, 13 Aug 2004 09:43:34 +0100, "H" <EMAIL REMOVED> 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# )


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Detecting Currency Settings?
Old
  (#3)
Rick Rothstein
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM

> 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
   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Detecting Currency Settings?
Old
  (#4)
H
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM


"J French" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED...
> On Fri, 13 Aug 2004 09:43:34 +0100, "H" <EMAIL REMOVED> 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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Detecting Currency Settings?
Old
  (#5)
Randy Birch
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM

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" <EMAIL REMOVED> wrote in message
news:EMAIL REMOVED...
: 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
:
:

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Detecting Currency Settings?
Old
  (#6)
Randy Birch
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM

.... 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" <EMAIL REMOVED> wrote in message
news:rKdTc.1687581$EMAIL REMOVED 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" <EMAIL REMOVED> wrote in message
: news:EMAIL REMOVED...
:: 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
::
::
:

   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Re: Detecting Currency Settings?
Old
  (#7)
H
Guest
 
Posts: n/a
Default Re: Detecting Currency Settings? - 06-04-2007, 09:45 AM

Thanks Randy,

It does indeed work very nicely with the new code.

Ta!

Hellen.

"Randy Birch" <EMAIL REMOVED> wrote in message
news:iNdTc.1687610$EMAIL REMOVED .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" <EMAIL REMOVED> wrote in message
> news:rKdTc.1687581$EMAIL REMOVED 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" <EMAIL REMOVED> wrote in message
> : news:EMAIL REMOVED...
> :: 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


   
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Contact Us - Forum Care Forums - Archive - Top