Home All Groups Group Topic Archive Search About

NumberFormatInfo - currency symbol on the left??

Author
28 Apr 2006 10:48 AM
Sam Martin
Hi,

I've got a web app where i need to show values in specific currencies.

for the session i create a Customised CultureInfo which is derived from the
culture of the browser, for example, french-france (fr-FR)

they display their currencies like 23,22 EUR (symbol)

I have a change currency option on the site that applies a multiplier to
values shown on the site, but when the user changes the currency to say GPB,
i want the currencies to be displayed with the currency sign on the left,
i.e. £23,22 but maintaining the culture decimal and group characters.

My custom CultureInfo has a NumberFormatInfo class, which I change the
currency symbol for; BUT i cannot see how to change the side in which the
symbol is rendered.

e.g.
NumberFormatInfo nfi = (NumberFormatInfo)base.NumberFormat.Clone();
nfi.CurrencySymbol = [myCurrencySign]; // in this case "£"

// what property determines which side the currency sign is shown??
nfi.<Property> = ??

Hope that make sense

--
TIA
Sam Martin

Author
28 Apr 2006 11:16 AM
Göran Andersson
> My custom CultureInfo has a NumberFormatInfo class, which I change the
> currency symbol for; BUT i cannot see how to change the side in which the
> symbol is rendered.
>
> e.g.
> NumberFormatInfo nfi = (NumberFormatInfo)base.NumberFormat.Clone();
> nfi.CurrencySymbol = [myCurrencySign]; // in this case "£"
>
> // what property determines which side the currency sign is shown??
> nfi.<Property> = ??

Use the CurrencyPositivePattern and CurrencyNegativePattern properties
to decide the position of the currency symbol.
Author
28 Apr 2006 11:30 AM
Sam Martin
thanks mate
sorted now
--
TIA
Sam Martin


Show quote
"Göran Andersson" wrote:

> > My custom CultureInfo has a NumberFormatInfo class, which I change the
> > currency symbol for; BUT i cannot see how to change the side in which the
> > symbol is rendered.
> >
> > e.g.
> > NumberFormatInfo nfi = (NumberFormatInfo)base.NumberFormat.Clone();
> > nfi.CurrencySymbol = [myCurrencySign]; // in this case "£"
> >
> > // what property determines which side the currency sign is shown??
> > nfi.<Property> = ??
>
> Use the CurrencyPositivePattern and CurrencyNegativePattern properties
> to decide the position of the currency symbol.
>

AddThis Social Bookmark Button