Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have a Field, that has Type="Number". What type of variables can I assign to it? Will the field support float or double?

oListItem["numberField"] = data;

What type can data be?

Cross posted from StackOverflow

share|improve this question
    
FYI... We try to avoid cross posting questions between sites because it is difficult for future visitors to find information scattered across multiple sites. In the future, can you try posting on one site first? In this case, you got two completely different answers so I guess I'll leave it here. –  Kit Menke Apr 18 '12 at 13:41
add comment

1 Answer 1

up vote 3 down vote accepted

Could be Double or Decimal or Integer.

Use the ParseAndSetValue method to make sure it converts it to Double (see here http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spfieldnumber.parseandsetvalue.aspx)

share|improve this answer
    
... or string. Also keep in mind that ParseAndSetValue is SP2010 specific method. –  Vedran Rasol Apr 18 '12 at 10:24
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.