Sharepoint Calculated Column’s Formula Syntax changes by specific culture.

Symptom :

One of our customer complain that after migrate Sharepoint 2007 farm to Sharepoint 2010 farm and implement turkish language pack , calculated column of formula is not working.And Getting error The Formula contains a syntax error is not supported.

Solution:

Change the culture settings to previous language than see it will work. If you load Turkish Language Pack and define Religional Settings -> Culture as Turkish , Calculated Column Formula syntax has changed to use “;” semi colon instead of “,” colon. Because Decimal seperator is “,” colon  in some cultures like Turkish and this cause a conflict between Calculated Column Formule Syntax  Parameter seperator and Decimal Seperator.

For Example:

SUM(10.10 , 10.20 , 10.30)  it s working en-US as total of 30.60

SUM(10,10 , 10,20 , 10,30)  its working wrong  tr-TR as total of 120.

Here is the right usage:

SUM(10,10 ; 10,20 ; 10,30)

In Migration senarios you have to careful for culture differences between two product.

Happy Migrations..

c# getting day name for specific culture

Here is a small example for getting day name of a date by specific culture:

 

DateTime startDate = DateTime.Now;

DateTime endDate = DateTime.Now.AddDays(2);

 

CultureInfo c = new CultureInfo("tr-TR");

string startDayName = c.DateTimeFormat.DayNames[(int)startDate.DayOfWeek];

string endDayName = c.DateTimeFormat.DayNames[(int)endDate.DayOfWeek];

 

 

Happy Tips.