HighTechTalks DotNet Forums  

cultureinfo currency

Dotnet Internationalization microsoft.public.dotnet.internationalization


Discuss cultureinfo currency in the Dotnet Internationalization forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
AT
 
Posts: n/a

Default cultureinfo currency - 06-29-2006 , 12:08 PM






I don't know if this is the proper group for this question.

¿Where is the information of the locale infos saved?

I set the cultureinfo to es-Es, and the currency appear as "pesetas",
that is the currency used before the 2000 in spain.

What i have to change to show "€" (euro)

Thanks in advance and excuse my poor english.
Jokin


Reply With Quote
  #2  
Old   
AT
 
Posts: n/a

Default RE: cultureinfo currency - 06-29-2006 , 08:38 PM






Hi Jokin. The .NET runtime should show the Euro symbol by default for this
culture. This is stored in the
System.Globalization.NumberFormatInfo.CurrentInfo. CurrencySymbol property.

// begin

using System;
using System.Collections.Generic;
using System.Text;
using System.Globalization;
using System.Threading;

namespace currencyconsole
{
class Program
{
static void Main(string[] args)
{
CultureInfo ci = new CultureInfo("es-ES");
Thread.CurrentThread.CurrentCulture = ci;
decimal d = 12345678.90M;
Console.WriteLine("The currency symbol for {0} is {1}.",
ci.EnglishName, NumberFormatInfo.CurrentInfo.CurrencySymbol);
Console.WriteLine("Example: {0:C}", d);
Console.ReadLine();
}
}

// end

(Note: The Euro symbol won't render correctly by default in a command
prompt, but you can change the codepage to Unicode by typing 'chcp 65001',
then set the font property to Lucida Console.)

Garrett McGowan [MSFT Developer International]

This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
--------------------
Quote:
From: jokin.c (AT) gmail (DOT) com
Newsgroups: microsoft.public.dotnet.internationalization
Subject: cultureinfo currency
Date: 29 Jun 2006 09:08:30 -0700

I don't know if this is the proper group for this question.
Where is the information of the locale infos saved?
I set the cultureinfo to es-Es, and the currency appear as "pesetas",
that is the currency used before the 2000 in spain.
What i have to change to show "€" (euro)
Thanks in advance and excuse my poor english.
Jokin



Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.