all groups > dotnet internationalization > april 2006 >
You're in the

dotnet internationalization

group:

Localizing Percentage value



Localizing Percentage value Sean
4/2/2006 8:54:01 AM
dotnet internationalization: Hi,

I'm running into issue using culture specific percentage value formatting
using .Format("P).

My code is:

NumberFormatInfo.nfi = new CultureInfo("en-US").NumberFormat;
dst.Text = d.ToString("p", nfi);

where:
d is a double value.

According to MSDN help online , the value should be formatted as xx% (no
space between number xx and percent symbol), what I get is xx % (space
between).

My final result should be for en-US culture without space. IS there a
problem with framework? How can I actually force CultureInfo to adjust to
follow custom rule for percentage without stripping it off manually or
creating a wrapper?

Thank you in advance.
Re: Localizing Percentage value Sean
4/2/2006 9:11:03 PM
Yet here (http://msdn2.microsoft.com/en-us/library/dwhawy9k(VS.80).aspx) it
has no spaces. But I was looking into PercentPattern, and it seems like
solution to my question resides there
(http://msdn2.microsoft.com/en-us/library/system.globalization.numberformatinfo.percentpositivepattern(VS.80).aspx).

[quoted text, click to view]
Re: Localizing Percentage value Alexey Smirnov
4/2/2006 10:50:06 PM
hmm, I see, for example, here that for en-US they use a space in between

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemGlobalizationNumberFormatInfoClassPercentGroupSeparatorTopic.asp



[quoted text, click to view]

Re: Localizing Percentage value Alexey Smirnov
4/3/2006 12:00:00 AM
this is interesting, thanks for the link!


[quoted text, click to view]

AddThis Social Bookmark Button