On Aug 29, 2006, at 11:30 AM, Bruce Moore wrote:

I see how to use constants that respond to the OS country preference and I see that some formatting preferences made in the operating system control panels automatically change number formatting ... but what about reading and implementing the currency symbol preference? You can't just go by the country since UK supposedly uses Euro and Pounds Sterling.

I am not much help for you here... but I am sure there are declares for this (check Windows Functionality Suite).

I'd also like to be able to read the "units" preference for English vs. Metric.

Here is the function I use, but it *doesn't* work with Linux. Credit for the Windows code goes to Aaron Ballman with the Windows Functionality Suite, but I don't remember where I found the Apple declare (I think I looked it up directly from the Apple site).

Function LocaleUsesMetric() As Boolean
  #If TargetMacOS
    Soft Declare Function IsMetric Lib MacOSLib () as Boolean
If System.IsFunctionAvailable("IsMetric", MacOSLib) Then Return IsMetric
  #Elseif TargetWin32
Soft Declare Function GetLocaleInfo Lib "kernel32" Alias "GetLocaleInfoA" (Locale As integer, _
    LCType As integer, lpLCData As ptr, cchData As integer) As Integer
    Const LOCALE_USER_DEFAULT = &H400
    Const LOCALE_IMEASURE = &h000000D
    Dim ret As Integer
    Dim mb As New MemoryBlock(4)
    If System.IsFunctionAvailable("GetLocaleInfo", "kernel32") Then
      ret = GetLocaleInfo( LOCALE_USER_DEFAULT, LOCALE_IMEASURE, mb, 2)
      Return (mb.Short(0) = 0)
    End If
  #Endif
End Function



_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to