Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Get or set system decimal symbol
Message
 
To
16/07/2001 02:48:36
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00530859
Message ID:
00530990
Views:
12
Hi!
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 SetLocaleInfo Lib "kernel32" Alias "SetLocaleInfoA" _
(ByVal Locale As Long, ByVal LCType As Long, ByVal lpLCData As String) As Long
Private Const LOCALE_SDECIMAL = &HE      '  decimal separator
Private Const LOCALE_STHOUSAND = &HF     '  thousand separator
Private Const LOCALE_SDATE = &H1D        '  date separator
Private Const LOCALE_STIME = &H1E        '  time separator

Dim CData As String * 4
Call GetLocaleInfo(0, LOCALE_SDECIMAL, CData, 4)
DecSym = Left(CData, 1)
Call GetLocaleInfo(0, LOCALE_STHOUSAND, CData, 4)
GroupSym = Left(CData, 1)
Call GetLocaleInfo(0, LOCALE_SDATE, CData, 4)
DateSep = Left(CData, 1)
Call GetLocaleInfo(0, LOCALE_STIME, CData, 4)
TimeSep = Left(CData, 1)
To set new settings use SetLocaleInfo() by the same way.

>How to get or set system: decimal symbol, digit grouping separator, time separator, date separator from Regional settings properties.
Previous
Reply
Map
View

Click here to load this message in the networking platform