none
Why does N'Ko default to 3 digits after the decimal? — every single other culture in Windows uses 2. RRS feed

  • Question

  • I cannot find any information on this and I am very curious why it is the case.

    In C#, the "No. of digits after decimal" setting manifests in numbers printed with the "F" decimal format or Numeric ("N") format having three decimal places instead of two (as found in every other culture).

    I am not a speaker of the N'Ko language, nor a user of the N'Ko alphabet (which is also used by several other languages). I don't have any issue I need to solve around the number of decimal places. I am just curious why Microsoft has chosen to give this culture 3 decimal digits, whereas every other one uses 2.

    Note the default currency setting for N'Ko uses 2 decimal places, so it is presumably unrelated to the Guinea Franc, which uses 1/100 subunits (centime).

    I checked all Windows cultures in C# via CultureInfo.GetCultures(CultureTypes.AllCultures) and found only N'ko (codes: nqo and nqo-GN) uses 3 decimal places, whereas all others use 2.

    example:

    new CultureInfo("nqo").NumberFormat.NumberDecimalDigits == 3; // true only for "ngo" and "ngo-GN"

    I would love an explanation of why this is.

    I have searched the web, dug through articles about N'Ko, and even offered a bounty on StackExchange, but found no inkling of an answer. I'd love an answer from someone who might know or from a Microsoft engineer.

    I came across this issue while working on my own TimeSpanParser, which I wish to internationalize.

    Thanks for your answer.


    Wednesday, April 18, 2018 1:54 AM

All replies

  • Hi Qubei,

    Thank you for posting here.

    The NumberFormatInfo.NumberDecimalDigits Property return the number of decimal places to use in numeric values. The default for InvariantInfo is 2. Based on my search, the nqo is not accepted for names and identifiers in predefined CultureInfo.

    For the predefined CultureInfo of names and identifiers, you could refer to the link below.

    http://www1.cs.columbia.edu/~lok/csharp/refdocs/System.Globalization/types/CultureInfo.html

    I also see your thread in STackOverFlow. I check the No. of digits after decimal in Region seetings what Ben Croughs said. It is a new idea. I think it may be why. But when I try to change 2 to 3 in Region. It does not work.

    You could change the nqo digits 3 to 2 use the C# format F or N.

    Try the code below.

      // Gets a NumberFormatInfo associated with the en-US culture.
                NumberFormatInfo nfi = new CultureInfo("nqo-GN", false).NumberFormat;
    
                // Displays a negative value with the default number of decimal digits (2).
                Int64 myInt = 1234;
                Console.WriteLine(myInt.ToString("F2", nfi));
    
                // Displays the same value with four decimal digits.
                nfi.NumberDecimalDigits = 2;
                Console.WriteLine(myInt.ToString("N", nfi));

    Best Regards,

    Wendy

    Note: This response contains a reference to a third-party World Wide Web site. Microsoft is providing this information as a convenience to you.
    Microsoft does not control these sites and has not tested any software or information found on these sites; Therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Friday, April 20, 2018 6:55 AM
    Moderator
  • I have searched the web, dug through articles about N'Ko, and even offered a bounty on StackExchange, but found no inkling of an answer.

    Followers of this thread may be interested in reading this related thread started
    by the OP which contains additional details:

    "Why does N'ko use 3 decimal places for displaying Fixed-Point (“F”)
    numbers while literally every other culture uses 2?"
    https://stackoverflow.com/questions/49807906/why-does-nko-use-3-decimal-places-for-displaying-fixed-point-f-numbers-whil

    Referencing multiple threads on the same topic from the same thread
    starter may help responders avoid spending time on posting material
    already covered in another thread.

    - Wayne

    Friday, April 20, 2018 7:24 AM