|
|
|
|
|
Dicas
|
|
Visual Basic (Datas/Números/Strings)
|
|
|
Título da Dica: Capturar o formato da Moeda
|
|
|
|
Postada em 14/8/2000 por Webmaster
webmaster@vbweb.com.br
------- OPÇÃO 1 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
Const LOCALE_SCURRENCY As Long = &H14 Const LOCALE_SYSTEM_DEFAULT As Long = 0
Private Sub Form_Click() CurrencyFormat$ = Space(100) i% = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT, _ LOCALE_SCURRENCY, CurrencyFormat$, 100) CurrencyFormat$ = Left(CurrencyFormat$, i% - 1) Debug.Print CurrencyFormat$ End Sub
------- OPÇÃO 2
Private Sub Form_Click() CurrencyFormat$ = Format(1,"Currency") CurrencyFormat$ = Trim(Left(CurrencyFormat$, _ InStr(CurrencyFormat$,"1")-1)) End Sub
|
|
|
|
|