如何使用Enum处理CSOM中的FieldCurrency设置货币格式

时间:2017-07-14 07:00:15

标签: sharepoint sharepoint-online csom

如何设置货币格式,如₹123,456.00(印度)。我们可以使用Sharepoint Online进行设置。我想知道如何使用CSOM设置它。是否有enum类型设置CurrencyLocaleId。谢谢。

using (ClientContext context = new ClientContext("https://rohith.sharepoint.com/sites/site"))
        {
            context.Credentials = new SharePointOnlineCredentials(username, password);
            ListCreationInformation listinfo = new ListCreationInformation();
            List list = context.Web.Lists.GetByTitle("Custom List");
            context.Load(list);

            FieldCurrency fieldCurrency = context.CastTo<FieldCurrency>(list.AddField("Price", "Currency"));
            //Here how to set Currency Format
            fieldCurrency.CurrencyLocaleId = 1081;

            fieldCurrency.Update();
            ListItemCreationInformation itemCreateInfo = new ListItemCreationInformation();

            ListItem listItem = list.AddItem(itemCreateInfo);
            listItem["Title"] = "Books";
            listItem["Quentity"] = 12;
            listItem["Price"] = 100;

            listItem.Update();
            context.ExecuteQuery();
        }

0 个答案:

没有答案