yronium Level: Moderator

 Registered: 14-04-2002 Posts: 907
|
Re: API and Locale Info...
Hello. Am I a bit late?
Anyway, I copy and paste the tip from a web page I found.
quote: Get the decimal separator and digit grouping symbol
To obtain the current user's settings for the decimal separator and digit grouping symbol, use the GetLocaleInfo function. You can use the same method to retrieve a slurry of other useful information, such as the names of months and days, language, currency format etc.
Private Const LOCALE_USER_DEFAULT& = &H400
Private Const LOCALE_SDECIMAL& = &HE
Private Const LOCALE_STHOUSAND& = &HF
Private Declare Function GetLocaleInfo& Lib "kernel32" Alias _
"GetLocaleInfoA" (ByVal Locale As Long, ByVal LCType As Long, _
ByVal lpLCData As String, ByVal cchData As Long)
Private Function ThousandSeparator() As String
Dim r As Long, s As String
s = String(10, "a")
r = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_STHOUSAND, s, 10)
ThousandSeparator = Left$(s, r)
End Function
Private Function DecimalSeparator() As String
Dim r As Long, s As String
s = String(10, "a")
r = GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_SDECIMAL, s, 10)
DecimalSeparator = Left$(s, r)
End Function
|
The source page is at this link.
Hope it helps, and sorry for delay.
____________________________
Real Programmer can count up to 1024 on his fingers
|