Sapete se con la SOLA funzione Format() sia possibile ottenere il "punto" anziché la virgola, quale simbolo separatore della parte decimale da quella intera in un numero in virgola mobile ?
Una cosa così potrebbe servire?System.Language = "en_US.UTF-8"
Print Format(1234.56, "#.00")
System.Language = "it_IT.UTF-8"
Print Format(1234.56, "#.00")
Ma temo di no :-[
PS Però funziona anche con la grafica es:
Public Sub Form_Open()
System.Language = "en_US.UTF-8"
TextBox1.Text = Format(1234.56, "#.00")
System.Language = "it_IT.UTF-8"
TextBox2.Text = Format(1234.56, "#.00")
End
Prego
Non so cosa devi fare, ma io opterei piuttosto per un modulo o una classe tipo questa Classe CFormat:
' Gambas class file
' CFormat.class code:
Create Static
Public Sub Dot(value As Variant) As String
Dim sValue As String
Try sValue = Format(value, "#.00") ' <-- cambiando il format secondo esegenza
If Error Then
Return Null
Else
Return Replace(sValue, ",", ".")
Endif
End
Che puoi richiamare con:
Public Sub Form_Open()
TextBox1.Text = CFormat.Dot(1234.567)
TextBox2.Text = CFormat.Dot("33")
End
:ciao:
Naturalmente il metodo Dot è limitato, se serve la formattazione americana il metodo USA sarebbe più adatto:
Public Sub USA(value As Variant, sFormat As String) As String
Dim sLanguage As String = System.Language
Dim sResult As String
System.Language = "en_US.UTF-8"
Try sResult = Format(value, sFormat)
System.Language = sLanguage
Return sResult
End
:ciao: