Localization Issue

3 posts, 0 answers
  1. Nikolaj
    Nikolaj avatar
    3 posts
    Member since:
    Aug 2011

    Posted 17 Aug 2011 Link to this post

    It seems you're using the local decimal denoter when writing floats and doubles. Take this example, in a Danish locale:
    Vector2 vector2 = new Vector2((float)rectangle.Width * 0,5, (float)rectangle.Height * 0,5);

    Notice the two decimal numbers use comma instead of period. Comma is the standard in Denmark, but it means the produced code is useless.

    EDIT:
    Actually, it seems to only happen in some cases.
  2. Nikolaj
    Nikolaj avatar
    3 posts
    Member since:
    Aug 2011

    Posted 20 Aug 2011 Link to this post

    Quick reproduction instructions

    static void Main(string[] args)
    {
        Console.WriteLine(0.30f);
        Console.WriteLine(0.30);
        Console.ReadKey(true);
    }

    Is decompiled into this

    private static void Main(string[] args)
    {
        Console.WriteLine(0,3);
        Console.WriteLine(0.30);
        Console.ReadKey(true);
    }

    Here's my localization settings: clicky

    It's obviously an issue with float/Single, as without the "f" suffix, it doesn't happen.
  3. DevCraft banner
  4. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 23 Aug 2011 Link to this post

    Hi Nikolaj,

    Thank you for reporting the issue. I am starting with the investigation of the localization problem. A fix will be provided in the next product update.

    Greetings,
    Kaloyan
    the Telerik team

    Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Back to Top