ASPX templates
Version 5.x > ASPX templates > Setting currency symbol to euro's without changing the culture View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
adam-syndicut - 5/13/2010 3:59:43 AM
   
Setting currency symbol to euro's without changing the culture
Hi doing a site that displays prices in euro.
it seems to work fine but then sometimes it does not display the euro sign it displays this character ¤
here is the code i am using.

NumberFormatInfo nfi = new NumberFormatInfo();

protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
SetupPage();
}

nfi.CurrencyDecimalDigits = 0;
nfi.CurrencySymbol = "€";
}

/* next bit is in side a method that is called within the page*/
if (CMSContext.CurrentDocument.GetValue("property_price_max") == null)
{
LtrPrice.Text = "Priced " + String.Format(nfi,"{0:c}", decimal.Parse(CMSContext.CurrentDocument.GetValue("property_price_min").ToString()));
}
else
{
LtrPrice.Text = "Priced from " + String.Format(nfi,"{0:c}", decimal.Parse(CMSContext.CurrentDocument.GetValue("property_price_min").ToString())) + "-" + String.Format(nfi,"{0:c}", decimal.Parse(CMSContext.CurrentDocument.GetValue("property_price_max").ToString()));
}

User avatar
Kentico Consulting
Kentico Consulting
kentico_mirekr - 5/17/2010 12:28:09 PM
   
RE:Setting currency symbol to euro's without changing the culture
Hi,

Could you please let me know when does this happen?

Is your web site accessible from the internet so I can take a look on this issue?

Could you please let me know why haven’t you defined currency in CMS Desk -> Tools -> E-commerce -> Configuration -> Currencies section?

Then you can use some e-commerce methods from ~\CMS\App_Code\CMSModules\Ecommerce\EcommerceFunctions.cs file to display formated price.

Best regards,
Miroslav Remias.