Number formating is incorrect for "ar-LY" culture

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

The number format in Libya is to have 3 digits after the decimal place.
I am basing this upon feedback from our Libyan customers. The following site
also reflects this standard: http://en.wikipedia.org/wiki/ISO_4217

However, in .Net as well as Windows the numbers are formatted with only 2
digits after the decimal for this culture. Microsoft has some good material
that accurately defines what they do for this locale at
http://www.microsoft.com/globaldev/nlsweb/default.mspx?submitted=1001&OS=Windows Vista

I have .Net programs that need to display the Amounts for various cultures,
and the Libyan formats are incorrect. How can I fix this?
 
Hi Andrew,

From your description, you're encountering some problem when formatting the
decimal value in Libya(ar-LY) culture, correct?

Based on the http://en.wikipedia.org/wiki/ISO_4217 link you provided, I
didn't find the detailed format and example of the Libya decimal/currency
number . And in the Microsoft NLS info page you referenced:

http://www.microsoft.com/globaldev/nlsweb/default.mspx?submitted=1001&OS=Win
dows%20Vista

it has show the decimal format as:

Positive sample ?.?.? 12,346.00

so isn't this your expected behavior or would you show me the exact format
of the expected Libya decimal or currency output?

BTW, what's the .net code you used to format the decimal value? Here is the
test code I used locally:

================
private void btnFormat_Click(object sender, EventArgs e)
{
decimal d = 323.5677M;

CultureInfo ci = new CultureInfo("ar-LY", false);

string output = d.ToString("C", ci.NumberFormat);

MessageBox.Show(output);
}
=================

Please feel free to let me know your concerns here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead



==================================================

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.



Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================



This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks Steven. Here are more details:

Yes, I am encountering a problem when formatting the decimal value in
Libya(ar-LY) culture. I am expecting 3 digits after the decimal, not 2
digits. 3 digits is the Libyan standard according to my customers in Libya.

In this wikipedia link, there is a list of ISO currencies.
http://en.wikipedia.org/wiki/ISO_4217
The 3rd column is titled "E[1]", and this shows the "Number of digits after
the decimal point.". (this is described in footnote [1] in the references
near the bottom)

So the expected format is 12,346.000
I think the problem is in Microsoft's NLS tables, which are defining the
wrong number of decimal places for this culture.

Here is the code sample we used (which I adapted from a Microsoft website):
double MyDouble = 123456789;
Thread.CurrentThread.CurrentCulture = new CultureInfo("ar-LY");
Console.WriteLine("The examples in ar-LY culture: ");
Console.WriteLine(MyDouble.ToString("N"));

Resulting output: The examples in ar-LY culture: 123,456,789.00

The desired result is:123,456,789.000

Thanks, Andrew
 
Thanks for your reply Andrew,

I'll perform some further research on this and will update you soon.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Andrew,

I've discussed this issue with some other global dev engineers and here are
some suggestion from them:

Since windows NLS catalog has used the 2 digs setting, you can consider the
following means:

=================
Manually change the setting in intl.cpl

a. In the Formats tab, click 'Customize this format¡­'
b. Change 'No. of digits after decimal:' from 2 to 3
c. Click 'Apply'

In native code, use SetLocaleInfo to change LOCALE_IDIGITS

In managed code, set NumberFormatInfo.NumberDecimalDigits to 3
=================

the problem here is that whenever your application deal with ar-LY, you
need to add additional code to customize the setting.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Hi Andrew,

Does the further information helps a little? If there is anything else we
can help, please feel free to post here.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Thanks for the responses Steven.
As you point out, the problem with your suggestions is that we need to
customize the code whenever dealiing with ar-LY culture. Since we have many
applications that must operate in many countries, it is an effort to get all
our developers to stop using the .Net code, and instead use our customized
classes.
Did your global dev engineers agree that this is a bug, and do they plan to
fix it?
Sincerely,
Andrew
 
Hi Andrew,

So far this problem should be an limitation as the built-in ar-LY culture's
number format info doesn't conform to the specification you mentioned.
However, this setting is originally consistent with the windows NLS and may
adopt another global standard specification. So far I haven't got any
definite info on updating this. But surely I think it a good idea to submit
such a suggestion to the dev team. You can post this request and comment to
our product feedback center:

http://connect.microsoft.com/feedback/default.aspx?SiteID=210

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top