Ik wil met de GetNumberFormat API zorgen dat m'n progje aan de locale van de gebruiker wordt aangepast, maar t lukt niet.
Dit geeft: User locale format: -1,234,567.89
Terwijl m'n locale toch echt op Nederlands staat en ik een "," als decimaal symbool gebruik (zo staat het ook in Control Panel). -1.234.567,89 zou het dus moeten zijn.
Heeft iemand enig idee wat het probleem kan zijn??
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| Option Explicit
Private Declare Function GetNumberFormat Lib "kernel32.dll" Alias "GetNumberFormatA" _
(ByVal Locale As Long, ByVal dwFlags As Long, ByVal lpValue As String, lpFormat _
As Any, ByVal lpNumberStr As String, ByVal cchNumber As Long) As Long
Private Const LOCALE_USER_DEFAULT = &H800
Private Sub Form_Load()
Dim formatted As String ' receives the formatted number strings
Dim strlen As Long ' the length of the formatted string
formatted = Space(256)
strlen = GetNumberFormat(LOCALE_USER_DEFAULT, 0, "-1234567.89", ByVal CLng(0), formatted, Len(formatted))
formatted = Left(formatted, strlen)
Debug.Print "User locale format: "; formatted
End Sub |
Dit geeft: User locale format: -1,234,567.89
Terwijl m'n locale toch echt op Nederlands staat en ik een "," als decimaal symbool gebruik (zo staat het ook in Control Panel). -1.234.567,89 zou het dus moeten zijn.
Heeft iemand enig idee wat het probleem kan zijn??