Detecting Currency Settings?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • H

    Detecting Currency Settings?

    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


  • J French

    #2
    Re: Detecting Currency Settings?

    On Fri, 13 Aug 2004 09:43:34 +0100, "H" <H@opijpoijpoij .com> wrote:
    [color=blue]
    >Hi All,
    >
    >Is it possible to detect a users regional settings, in particular -
    >Currency?[/color]

    The easiest way is
    N# = Val( 1000.01 )

    Then
    S$ = CStr( N# )


    Comment

    • Rick Rothstein

      #3
      Re: Detecting Currency Settings?

      > Is it possible to detect a users regional settings, in particular -[color=blue]
      > Currency?[/color]

      Regional Locale Currency Settings
      =============== =============== =
      VBnet provides Intermediate and Advanced Win32 API code for VB developers. Comprehensive Code, FAQ, Developers Resources & News, alphabetical API/Type/Constant/Method Index, along with the largest Visual Basic-related links list on the net.


      Regional Locale Numeric Settings
      =============== =============== =
      VBnet provides Intermediate and Advanced Win32 API code for VB developers. Comprehensive Code, FAQ, Developers Resources & News, alphabetical API/Type/Constant/Method Index, along with the largest Visual Basic-related links list on the net.


      Regional Locale Date Settings
      =============== ==============
      VBnet provides Intermediate and Advanced Win32 API code for VB developers. Comprehensive Code, FAQ, Developers Resources & News, alphabetical API/Type/Constant/Method Index, along with the largest Visual Basic-related links list on the net.


      Regional Locale Time Settings
      =============== ==============
      VBnet provides Intermediate and Advanced Win32 API code for VB developers. Comprehensive Code, FAQ, Developers Resources & News, alphabetical API/Type/Constant/Method Index, along with the largest Visual Basic-related links list on the net.


      Rick - MVP

      Comment

      • H

        #4
        Re: Detecting Currency Settings?


        "J French" <erewhon@nowher e.com> wrote in message
        news:411cb66b.1 10203288@news.b tclick.com...[color=blue]
        > On Fri, 13 Aug 2004 09:43:34 +0100, "H" <H@opijpoijpoij .com> wrote:
        >[color=green]
        >>Hi All,
        >>
        >>Is it possible to detect a users regional settings, in particular -
        >>Currency?[/color]
        >
        > The easiest way is
        > N# = Val( 1000.01 )
        >
        > Then
        > S$ = CStr( N# )
        >
        >[/color]

        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


        Comment

        • Randy Birch

          #5
          Re: Detecting Currency Settings?

          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

          Please respond only to the newsgroups so all can benefit.


          "H" <H@opijpoijpoij .com> wrote in message
          news:CDydnTQX85 J_4oHcSa8jmw@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
          :
          :

          Comment

          • Randy Birch

            #6
            Re: Detecting Currency Settings?

            .... 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

            Please respond only to the newsgroups so all can benefit.


            "Randy Birch" <rgb_removethis @mvps.org> wrote in message
            news:rKdTc.1687 581$Ar.1136710@ 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:CDydnTQX85 J_4oHcSa8jmw@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
            ::
            ::
            :

            Comment

            • H

              #7
              Re: Detecting Currency Settings?

              Thanks Randy,

              It does indeed work very nicely with the new code.

              Ta!

              Hellen.

              "Randy Birch" <rgb_removethis @mvps.org> wrote in message
              news:iNdTc.1687 610$Ar.66078@tw ister01.bloor.i s.net.cable.rog ers.com...[color=blue]
              > ... 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" <rgb_removethis @mvps.org> wrote in message
              > news:rKdTc.1687 581$Ar.1136710@ 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:CDydnTQX85 J_4oHcSa8jmw@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
              > ::
              > ::
              > :
              >[/color]


              ---
              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


              Comment

              Working...