Option Compare Database
Option Explicit
Private 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
Private Declare Function GetUserDefaultLCID% Lib "kernel32" ()
Private Const LOCALE_SNATIVELANGNAME = &H4 ' native name of language
Private Const LOCALE_SNATIVECTRYNAME = &H8 ' native name of country
Private Const LOCALE_SCURRENCY = &H14 ' local monetary symbol
Private Const LOCALE_SINTLSYMBOL = &H15 ' intl monetary symbol
Private Const LOCALE_SMONDECIMALSEP = &H16 ' monetary decimal separator
Private Const LOCALE_SMONTHOUSANDSEP = &H17 ' monetary thousand separator
Private Const LOCALE_SMONGROUPING = &H18 ' monetary grouping
Private Const LOCALE_ICURRDIGITS = &H19 ' local monetary digits
Private Const LOCALE_USER_DEFAULT = &H400
Private Const LOCALE_SENGLANGUAGE = &H1001 ' English name of language
Private Const LOCALE_SENGCOUNTRY = &H1002 ' English name of country
Function cp_currency() As String
Dim Symbol As String
Dim iRet1 As Long
Dim iRet2 As Long
Dim lpLCDataVar As String
Dim Pos As Integer
Dim locale As Long
cp_currency = "\"
locale = GetUserDefaultLCID()
iRet1 = GetLocaleInfo(locale, LOCALE_SCURRENCY, lpLCDataVar, 0)
Symbol = String$(iRet1, 0)
iRet2 = GetLocaleInfo(locale, LOCALE_SCURRENCY, Symbol, iRet1)
Pos = InStr(Symbol, Chr$(0))
If Pos > 0 Then
cp_currency = Left$(Symbol, Pos - 1)
End If
End Function
Function cp_digit() As Integer
Dim Symbol As String
Dim iRet1 As Long
Dim iRet2 As Long
Dim lpLCDataVar As String
Dim Pos As Integer
Dim locale As Long
cp_digit = 0
locale = GetUserDefaultLCID()
iRet1 = GetLocaleInfo(locale, LOCALE_ICURRDIGITS, lpLCDataVar, 0)
Symbol = String$(iRet1, 0)
iRet2 = GetLocaleInfo(locale, LOCALE_ICURRDIGITS, Symbol, iRet1)
Pos = InStr(Symbol, Chr$(0))
If Pos > 0 Then
cp_digit = Left$(Symbol, Pos - 1)
End If
End Function
'Office' 카테고리의 다른 글
[Access] Excel 파일에 값 쓰기 (0) | 2023.05.18 |
---|---|
[Access] BETWEEN에서 날짜사용시 문제점 (0) | 2023.05.04 |
[Excel] Excel VB 에서 Serial 통신하기 (0) | 2023.05.04 |
[Excel] VB6 Excel 현재 Directory 구하기 (0) | 2023.05.04 |
[Excel] VB6 Excel 시트보호 된 셀에 에러발생시 처리 (0) | 2023.05.04 |