none
NumberGroupSizes for “en-IN” culture in windows server 2012 is weird RRS feed

  • Question

  • I have this simple code implemented in .NET console application.

    NumberFormatInfo nfi = new CultureInfo("en-IN", false).NumberFormat;
    
    Int64 myInt = 123456789012345;
    Console.WriteLine(myInt.ToString("N", nfi));
    Console.ReadKey();

    When running this code on Windows Server 2012 machine the output it gives is

    "1234567890,12,345.00"

    While on all other machines such as Windows Server 2008 R2, Windows 8, Windows 10 etc the output is

    "12,34,56,78,90,12,345.00"

    I figured that the "NumberGroupSizes" property of "NumberFormatInfo" as different values between Windows Server 2012 and other Windows OS machines.

    Can any one explain the reason behind this? Why Windows Server 2012 has to have this weird behavior which can cause a potential application breaking?

    Also can't find forum for Windows Server 2012. Not sure if this question will fall in to correct category and forum.


    Chetan Ranpariya

    Tuesday, February 14, 2017 11:26 AM