• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

The input string '1.25' was not in a correct format

Messages
3,366
Country
germany
Hi Arno. I have re-staged my computer and reinstalled MCX. The decimal delimiter is set to a point. The current version keeps telling me constantly what is mentioned in the title.

Any idea what I am doing wrong?

Informationen über das Aufrufen von JIT-Debuggen
anstelle dieses Dialogfelds finden Sie am Ende dieser Meldung.

************** Ausnahmetext **************
System.FormatException: The input string '1,25' was not in a correct format.
at System.Number.ThrowFormatException[TChar](ReadOnlySpan`1 value)
at System.Convert.ToSingle(String value)
at ASToFra.Utils.FormMemory.GetStateDict(String formState)
at ASToFra.Utils.FormMemory.FormMemory_FormClosing(Object sender, FormClosingEventArgs e)
at System.Windows.Forms.Form.WmClose(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(HWND hWnd, MessageId msg, WPARAM wparam, LPARAM lparam)
 

Attachments

  • mcx1.jpg
    mcx1.jpg
    55.7 KB · Views: 11
Can you try to clear your settings (see the manual for where they are stored).
 
I had a look at the code, this error must happen when the display scaling is read. The error seems to indicate that a value of 1,25 is stored (notice the comma). Could it be that you use MCX before with the decimal character still set to comma and now you have changed it to dot? I think that is what is causing this error.

Clearing the settings should solve this. I could probably make the code more robust for this, but not sure how often this situation will happen.
 
Exactly that happened, Arno. No problem to clear the settings. Thanks for finding this out so fast.
 
Hi Arno

I'm not sure if this will help, but I ran into a similar problem recently updating P3D3 when parsing latitude and longitude (doubles) on different localisations. What I did was to clone the user's localisation and then force the decimal separator to be a point (chr(46)) on the application thread only.
Code:
        Dim data As String = Nothing
(...)
        ' Force the decimal separator to be a period on this thread
        data = CultureInfo.CurrentCulture.Name
        If Microsoft.VisualBasic.Left(LCase(data), 3) <> "en-" Then
            Dim cinfo As CultureInfo = Thread.CurrentThread.CurrentCulture.Clone()
            cinfo.NumberFormat.NumberDecimalSeparator = "."
            Thread.CurrentThread.CurrentCulture = cinfo
        End If
For me, this meant that any doubles that were stored always had a decimal point as the separator.
 
Thanks, I'm not sure that forcing the dot is a good solution in general. Now that there are more users of MCX that use MSFS only it would make sense that they can just run with the comma as decimal character. It's only XtoMDL that has the bug that it needs the dot to be set.
 
Back
Top