[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Format and Format$
[Thread Prev] | [Thread Next]
- Subject: Re: Format and Format$
- From: Gianluigi <gradobag@xxxxxxxxxxx>
- Date: Sun, 12 Jan 2025 14:31:07 +0100
- To: user@xxxxxxxxxxxxxxxxxxxxxx
Il 12/01/25 11:35, Charlie Reinl ha scritto:
Salut, I have to represent strings like "17,4" or "12" or "0" or "1.001,5" always with 2 or 4 digits, and there is the problem, the current language is 'de_DE' but for the decimal separator I need a dot like in 'en_EN'. Format prints me "17,4000", but I need "17.4000" Is there a way to achieve this with Format, or do I need to use REPLACE?
Hi, Something like that? Public Sub Form_Open() TextBox1.Text = LangFormat("en_US.UTF-8", "17,4000") TextBox2.Text = LangFormat("de_DE.UTF-8", "17,4000") End Private Sub LangFormat(sLang As String, s As String) As String Dim i As Integer i = ReturnInteger(s) System.Language = sLang s = Format((i / 10000), "#.0000") Return s End Private Sub ReturnInteger(sText As String) As Integer Dim i As Integer If sText Then sText = Replace(sText, ",", "") i = Val(sText) Endif Return i End
Re: Format and Format$ | Karl Reinl <karl.reinl@xxxxxxxxxx> |
Format and Format$ | Charlie Reinl <Karl.Reinl@xxxxxxxxxx> |