'Public Declarations
Declare Function GetLocaleInfo Lib "kernel32" Alias _
"GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, _
ByVal lpLCData As String, ByVal cchData As Long) As Long
Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Public Const LOCALE_SDECIMAL = &HE
Public gtLocalDecimal as String
'Determine and store the decimal early in your code
'Use where appropriate (gtLocalDecimal is a Public String)
gtLocalDecimal = fGetLocale(LOCALE_SDECIMAL)
Public Function fGetLocale(plSettingOfInterest) As String ' Retrieve the regional setting
Dim Symbol As String
Dim lRet1 As Long
Dim lRet2 As Long
Dim lpLCDataVar As String
Dim Pos As Integer
Dim Locale As Long
Dim x As Integer
Dim tTemp As String
Locale = GetUserDefaultLCID()
lRet1 = GetLocaleInfo(Locale, plSettingOfInterest, lpLCDataVar, 0)
Symbol = String(iRet1, vbNullChar)
lRet2 = GetLocaleInfo(Locale, plSettingOfInterest, Symbol, lRet1)
If Len(Symbol) > 0 Then
Symbol = Replace(Symbol, vbNullChar, "")
fGetLocale = Trim$(Symbol)
Else
fGetLocale = "."
End If
End Function