• Upgrade your Internet Experience
  • Sign in
  • Microsoft.com
  • United States (English)
    Brasil (Português)Česká republika (Čeština)Deutschland (Deutsch)España (Español)France (Français)Italia (Italiano)Россия (Русский)대한민국 (한국어)中华人民共和国 (中文)台灣 (中文)日本 (日本語)香港特别行政區 (中文)
 
 
.NET Framework Developer Center
 
 
Home
 
 
Library
 
 
Learn
 
 
Downloads
 
 
Support
 
 
Community
 
 
Forums
 
 
 
.NET Framework Developer Center > .NET Development Forums > .NET Base Class Library > Globalization.CultureInfo - CurrencyGroupSizes
Ask a questionAsk a question
Search Forums:
  • Search .NET Base Class Library Forum Search .NET Base Class Library Forum
  • Search All .NET Development Forums Search All .NET Development Forums
  • Search All MSDN Forums Search All MSDN Forums
 

AnswerGlobalization.CultureInfo - CurrencyGroupSizes

  • Friday, June 06, 2008 2:45 AMavinashraj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0
    Hello,

    The WinXp 'Customize Regional Options' dialog lets me select one of following three options for Digit Grouping -

    a) 123456789
    or
    b) 123, 456, 789
    or
    c) 12,34,56,789 and of course the grouping and decimal separator etc.

    Using .Net 2.0, and trying to read the CurrencyGroupSizes property returns an array with length 1 and group size = 3 for both option a and b.

    What I'd like to know is, how does one differentiate b/w the two options programatically ? I would like to perform specific processing in my application based on what the user has configured in his install of XP.

    Also the Display Leading Zeros option in the customize dialog, I could not find any matching property in the NumberFormat name space. How might I know what the user has set in XP without doing a win32 call ?

    Any ideas will be great.
    Regards,
    Avinash
    • ReplyReply
    • QuoteQuote
     

Answers

  • Friday, June 06, 2008 12:25 PMnobugzMVP, ModeratorUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    Vote As Helpful
    0
    Regional Options and NumberFormatInfo are an imperfect match.  You can in fact change settings that will prevent the framework from functioning properly.  There is no workaround I'm aware of that fixes all of the possible issues.  In your case, I'd parse a formatted currency value to see what options might have been selected by the user that would affect your output.
    Hans Passant.
    • Marked As Answer byavinashraj Monday, June 09, 2008 7:34 AM
    •  
    • ReplyReply
    • QuoteQuote
     

All Replies

  • Monday, June 09, 2008 7:39 AMavinashraj Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    Vote As Helpful
    0

    Thanks Hans. I tried doing that too.. but it seemed to me that x.ToString() [also tried other over loads with format 'C' , 'N' etc and also  explicitly passing in IformatInfo etc], it did not seem to respect my setting a) 123456789. It always seemed to include group separators.

    But I'm not fully certain and might have missed something. Will try it again and see how it goes. Atleast, I now know that ther's no straight forward API that I might have missed.

    Thanks again.

    Regards,

    Avinash

    • ReplyReply
    • QuoteQuote
     
Need Help with Forums? (FAQ)
 
© 2009 Microsoft Corporation. All rights reserved.
Terms of Use
|
Trademarks
|
Privacy Statement